Html Preview
HtmlPreview renders LLM-generated HTML inline using a hardened iframe sandbox. It mirrors how Mermaid is embedded in Markdown, but treats the content as code rather than data — scripts execute inside an isolated frame that cannot reach the host page.

- Library
- Lobe UI
- Framework
- React
- Type
- component
- License
- MIT
- Install
pnpm add @lobehub/ui- Files
src/HtmlPreview/buildShellSrcDoc.tssrc/HtmlPreview/buildStaticSrcDoc.tssrc/HtmlPreview/const.tssrc/HtmlPreview/HtmlPreview.tsxsrc/HtmlPreview/Iframe.tsxsrc/HtmlPreview/index.tssrc/HtmlPreview/injectAutoHeightScript.tssrc/HtmlPreview/injectStorageShim.ts
- Source
- https://github.com/lobehub/lobe-ui