The ViewHtml component safely renders HTML content using DOMPurify for sanitization.
It applies prose styling for better readability and prevents XSS attacks by cleaning
potentially dangerous HTML.
The component automatically sanitizes all HTML content before rendering, ensuring
that only safe HTML elements and attributes are displayed.
HTML Content
Rich HTML content with various elements and styling.
You can use bold , italic , and highlighted text.
Press Ctrl + V to paste.
Features
Semantic HTML
Accessible markup
Clean structure
HTML is the foundation of the web.
const html = '<div>Hello</div>';
Element
Purpose
<div>
Container
<span>
Inline
Last updated: Today
HTML Content
Rich HTML content with various elements and styling.
You can use bold , italic , and highlighted text.
Press Ctrl + V to paste.
Features
Semantic HTML
Accessible markup
Clean structure
HTML is the foundation of the web.
const html = '<div>Hello</div>';
Element
Purpose
<div>
Container
<span>
Inline
Last updated: Today
import { ViewHtml } from ' @fintech-sandpit/ui/react ' ;
const htmlContent = ' <h1>Hello World</h1><p>This is safe HTML content.</p> ' ;
< ViewHtml html = { htmlContent } />
< ViewHtml : html = " htmlContent " />
import { ViewHtml } from ' @fintech-sandpit/ui/vue ' ;
const htmlContent = ' <h1>Hello World</h1><p>This is safe HTML content.</p> ' ;
Name Type Required Default Description htmlstringYes — The HTML content to render. Will be sanitized using DOMPurify before display.