JSX Preview
A safe client-side JSX sandbox renderer for live AI UI generation.
The JSXPreview component safely renders dynamic JSX strings generated by models into live React DOM components.
Usage
tsx
import { JSXPreview } from "@celestia-project/ui"
export function MyJSXPreview() { const jsxCode = `<div className="p-3 bg-primary/10 rounded-lg text-primary text-xs font-semibold text-center">Live Generated JSX Component</div>`
return ( <JSXPreview jsx={jsxCode} className="w-full max-w-md" /> )}Props Reference
| Component | Prop | Type | Description |
|---|---|---|---|
JSXPreview | jsx | string | JSX markup string to parse and mount. |