Componenteditors0.43 KB gzipZero dependencies
Html Preview
Sandboxed HTML preview frame.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add html-previewOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { HtmlPreview } from "@/components/ui/html-preview"; <HtmlPreview />Source code
html-preview.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| html | string | Configures html. |
| title | string | Primary heading or title text. (Default: "HTML Preview") |
| height | string | Configures height. (Default: "240px") |
| sandbox | string | Configures sandbox. (Default: "") |