atoms
Inline SVG
Inlines SVG markup with its hard-coded fills removed so it takes the current colour, or falls back to an image from a URL.
Specimens
{{ Inline.render({
alt: "Sample logo",
classes: "w-16 h-16 text-primary-400",
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="#000"/></svg>'
}) }}{{ Inline.render({
alt: "Sample image",
src: "/assets/images/logos/default.svg",
classes: "w-16 h-16"
}) }}Params
| Param | Type | Description |
|---|---|---|
svg | string | Inline SVG markup (or a URL, used as the image source when it isn’t SVG). |
src | string | Image URL fallback. |
alt | string | Accessible name; defaults to "Award logo". |
classes | string | variant map | array | String, variant map, or array; applied through | classes to the <svg> or <img>. |
svgClasses | string | Extra classes for the <svg> only. |
preserveAspectRatio | string | Value for the <svg>'s preserveAspectRatio when the markup has none; defaults to "xMidYMin meet" (top-aligned). Pass "xMidYMid meet" to center the artwork in its box. |
preserveFills | boolean | Default false. When true, skips clearSVGFills and leaves fill-current off the root <svg> classes, so multi-colour artwork keeps its own fills. |
attrs | string | Optional, default empty. Injected verbatim onto the root <svg> tag (e.g. data-hero-el="statement-svg") so a caller can add a choreography hook. |