Component
Icon
Published on
Description
The Icon component renders an SVG icon from a sprite sheet using the <use> element. Icons are decorative by default with aria-hidden="true" and focusable="false".
Use icons alongside text labels to provide visual context. Avoid using icons as the sole means of conveying meaning without an accessible text alternative.
Example
Accessibility
- Icons are set to
aria-hidden="true"by default, hiding them from screen readers. - Icons use
focusable="false"to prevent focus in Internet Explorer and older Edge. - Always pair icons with visible text or provide an accessible label on the parent element.
References
- Alternative Text for CSS Generated Content (opens in new tab) — Adrian Roselli
- My Approach to Alt Text (opens in new tab) — Adrian Roselli
Related
- Badge — for count or status indicators
Variables
None