Content
Icon
A line icon in the current text colour, from a small fixed set. Decorative unless it has a label.
- Experimental
- No keyboard interaction
- Screen reader not tested yet
Playground
Change the props and the surface. The controls come from the documented props; the surfaces are the real modes.
<Icon name="spark" />Usage
When to use
Next to a word in navigation, so a place is easier to find again: the five areas of the docs sidebar carry one each.
When not to use
- As decoration, or to fill space next to a heading.
- Alone on a button: use a word. If an icon must stand alone, give it a label.
How it works
A small fixed set drawn on a 24 grid with a 1.75 stroke and round ends, the same drawing as the arrows in CaseTeaser and Link. It takes the current text colour, so hover, focus and surfaces work without variants. Without label it is hidden from screen readers.
Content guidelines
One icon per place, always the same one. A new icon is a change to the system, not to a screen.
Do and don’t
Do
- Pair an icon with a word: in navigation the label names the place, the icon helps find it again.
Don’t
- Don't add icons for decoration, and don't draw new ones inline: a missing icon is a gap in the set.
Anatomy
The parts of the component and what each one does, as in the playground above.
- icon24 grid, 1.75 stroke, round caps and joins, currentColor.
Examples
Type-checked, and the same code goes into the AI manifest. Import: import { Icon } from "@/ds";
The set
- foundations
- components
- patterns
- spark
- book
- home
- arrow-right
- external
md
Props
Checked against the component's TypeScript type on every build.
| Name | Type | Default | Description |
|---|---|---|---|
| name (required) | IconName | – | foundations, components, patterns, spark, book, home, arrow-right, external. |
| size | "sm" | "md" | "sm" | sm next to small text, md on its own. |
| label | string | – | Accessible name. Only when the icon stands alone and carries meaning. |
| className | string | – | Layout only. |
Tokens used
Derived from the utility classes in the component's source. Copy a class with one click.
| Token | Tier | Value | Utility |
|---|---|---|---|
| spacing.4 | semantic | 16px | |
| spacing.6 | semantic | 24px |
Accessibility
What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Not applicable |
| Screen reader | Manual | Not tested yet |
Semantics and focus
- Without label the icon is aria-hidden; with label it is an img with that name.