SVG
Render SVG markup with optional sanitization.
Quick Start
Live Preview
Sanitization
Sanitization is enabled by default and uses bleach. Install the optional extras:
To allow raw SVG as-is, disable sanitization:
You can also pre-sanitize SVG strings with render_svg if you want to reuse output.
Theming
Use currentColor inside your SVG to inherit text color and automatically adapt to light and dark themes.
Security Notes
Only disable sanitization for trusted SVG markup. Treat user-provided SVG as untrusted input.
API Reference
faststrap.components.display.svg.Svg(svg, *, sanitize=True, allowed_tags=None, allowed_attributes=None, allowed_protocols=None, **kwargs)
Render raw SVG into a styled container.