Pictogram
A pictogram is a <figure> that pairs an icon or illustration with a title and description in a centered or side-by-side layout. The icon is the required focal element; heading and description provide context.
Use it for feature lists, value propositions, "how it works" steps, benefit grids, and any place a small illustrated unit communicates a concept more clearly than text alone.
Implementation Notes
- Uses a native
<figure>element so the icon and caption are grouped semantically iconis required as a slot/snippet/ReactNode — it is NOT children- Icon container has
aria-hidden="true"because the icon is decorative; the accessible name comes from the heading orlabel layoutis exposed asdata-layout("centered" | "side", default "centered") for consumer stylinglabelis optional and overrides the implicit accessible namechildren(when provided) override the description in the caption
Props
layout: "centered" | "side" (default: "centered") -- icon positionheading: string (optional) -- title textdescription: string (optional) -- body texticon: slot/snippet/ReactNode (required) -- the icon contentlabel: string (optional) -- aria-label overridechildren: slot (optional) -- overrides description if provided...restProps: any additional HTML attributes
Usage
Centered pictogram:
<Pictogram heading="Privacy" description="Your data stays yours.">
{#snippet icon()}<svg>...</svg>{/snippet}
</Pictogram>
Side layout with custom caption content:
<Pictogram layout="side" heading="Speed">
{#snippet icon()}<svg>...</svg>{/snippet}
<p>Loads in under a second on any connection.</p>
</Pictogram>
Keyboard Interactions
- None (passive element); interactive children manage their own keyboard behavior.
ARIA
- Implicit
figuresemantics from the<figure>element - Icon container is
aria-hidden="true"(decorative) - Accessible name comes from the heading inside
<figcaption>or fromlabelif provided data-layoutis a non-ARIA hook for consumer styling
When to Use
- Use to introduce a feature, value, or step with a meaningful illustration.
- Use in three-up or four-up grids of capabilities.
- Use when the visual symbol genuinely aids comprehension.
When Not to Use
- Do not use for purely decorative imagery without a heading or description — use Image.
- Do not use to convey critical information via the icon alone — heading and description should carry meaning.
- Do not put an interactive control in the icon slot; put it in children below the description.
Headless
Renders a <figure> with an aria-hidden icon container, a <figcaption> holding the heading and description (or children). Visual layout, icon sizing, and typography are entirely the consumer's responsibility, with data-layout as a hook for "centered" vs "side" arrangements.
Styles
Consumer CSS targets the pictogram class. Use the data-layout="centered" and data-layout="side" attribute selectors to arrange the icon and caption. Style the inner pictogram-icon, pictogram-caption, pictogram-heading, and pictogram-description classes as needed.
Testing
- Verify the component renders a
<figure>element with classpictogram - Verify
data-layoutreflects thelayoutprop (default "centered") - Verify the icon container has
aria-hidden="true"and classpictogram-icon - Verify the heading renders inside
<figcaption>as<h3 class="pictogram-heading">when provided - Verify the description renders as
<p class="pictogram-description">when provided - Verify children replace the description when provided
- Verify
aria-labelis rendered whenlabelis provided
Advice
- Designers: Use a consistent icon family across pictograms in a grid. Maintain a stable caption height to keep grids aligned.
- Developers: Pass the icon via the dedicated
iconslot/prop, not children. This keepsaria-hiddenon the icon container without affecting other content.
Related components
icon— a container for displaying an iconfeature-photo— see components.tsvcard— a grouped content container with header, body, and footer areas
References
- MDN
<figure>: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure - MDN
<figcaption>: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption - MDN
aria-hidden: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden - Mozilla Protocol Design System: https://protocol.mozilla.org/