Componenteditors0.43 KB gzipZero dependencies

Html Preview

Sandboxed HTML preview frame.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add html-preview

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { HtmlPreview } from "@/components/ui/html-preview"; <HtmlPreview />

Source code

html-preview.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxhtml-preview.tsx38 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface HtmlPreviewProps extends React.HTMLAttributes<HTMLDivElement> {  html: string;  title?: string;  height?: string;  sandbox?: string;} /** Sandboxed HTML preview iframe. */export function HtmlPreview({  html,  title = "HTML Preview",  height = "240px",  sandbox = "",

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { HtmlPreview } from "@/components/ui/html-preview"; <HtmlPreview />
PropTypeDescription
htmlstringConfigures html.
titlestringPrimary heading or title text. (Default: "HTML Preview")
heightstringConfigures height. (Default: "240px")
sandboxstringConfigures sandbox. (Default: "")