Svg
SVG component for rendering inline SVG content from string sources with optional styling classes. Content is sanitized by default, but prefer trusted sources.
Source
Type Definition
function Svg({
src,
className,
unsafe
}: {
src: string
className?: string
unsafe?: boolean
}): JSX.ElementParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
src | string | ✅ | - | SVG content as a string to be rendered inline |
className | string | ❌ | - | CSS class name to apply to the container div |
unsafe | boolean | ❌ | - | Skip sanitization. By default scripts, event handlers, foreignObject and javascript: URLs are stripped. Only disable for trusted SVGs. |
Last modified: 2026-10-02