Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Primitives
  2. Icon
  3. Accessibility

Icon

Accessibility

Decorative versus labelled
Omit label for a decorative icon: the SVG gets aria-hidden="true" and no role. Use this when visible text beside the icon, or the control wrapping it, already conveys meaning. Pass label when the icon is the sole carrier of meaning at that point in the tree (for example a status glyph with no adjacent text). The SVG becomes role="img" with aria-label. Storybook LabelledVsDecorative demonstrates both cases; the labelled example uses the warning glyph with a localized label. label names the icon image, not a parent control. An icon button still needs its own accessible name on the button, not only on the inner icon.
Spin
spin is decorative: no role, name, or live region. The owning control announces busy state (aria-busy, a status region). Under reduced motion the glyph stops turning and stays visible. See Storybook Spin.
Color and contrast
Glyphs paint with stroke="currentColor" or fill="currentColor". Default foreground is Foreground.Inherit, so the icon follows the ancestor text color and whatever contrast that token already guarantees. When you set foreground explicitly, pick a token that clears the required ratio on its background (Storybook ForegroundMatrix).
Reduced motion
spin and rotation transitions respect reduced motion. Consumer animations on an icon remain the consumer's responsibility.
RTL
Directional glyphs (glyph.directional) mirror under :dir(rtl) with the CSS scale property (scale: -1 1), not a runtime direction check. Only glyphs on the generator allowlist mirror. Storybook edge cases cover RTL beside non-directional glyphs.
Previous
Icon / API and Development
Next
Interactable / Usage
On this page
Decorative versus labelled
Spin
Color and contrast
Reduced motion
RTL