buntal/components

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

View source on GitHub

Type Definition

function Svg({
  src,
  className,
  unsafe
}: {
  src: string
  className?: string
  unsafe?: boolean
}): JSX.Element

Parameters

ParameterTypeRequiredDefaultDescription
srcstring✅-SVG content as a string to be rendered inline
classNamestring❌-CSS class name to apply to the container div
unsafeboolean❌-Skip sanitization. By default scripts, event handlers, foreignObject and javascript: URLs are stripped. Only disable for trusted SVGs.

Last modified: 2026-10-02