Skip to main content

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

SVG markup The black fill is stripped, so the text colour wins.
{{ 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>'
}) }}
Image fallback Without SVG markup it renders an img from src.
Sample image
{{ Inline.render({
  alt: "Sample image",
  src: "/assets/images/logos/default.svg",
  classes: "w-16 h-16"
}) }}

Params

ParamTypeDescription
svgstringInline SVG markup (or a URL, used as the image source when it isn’t SVG).
srcstringImage URL fallback.
altstringAccessible name; defaults to "Award logo".
classesstring | variant map | arrayString, variant map, or array; applied through | classes to the <svg> or <img>.
svgClassesstringExtra classes for the <svg> only.
preserveAspectRatiostringValue 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.
preserveFillsbooleanDefault false. When true, skips clearSVGFills and leaves fill-current off the root <svg> classes, so multi-colour artwork keeps its own fills.
attrsstringOptional, default empty. Injected verbatim onto the root <svg> tag (e.g. data-hero-el="statement-svg") so a caller can add a choreography hook.