Skip to content
Xerobi Icons

Design accessibility

Designing icons that stay usable for people with different abilities, and what the library does and does not take care of.

Last updated

An icon file does not know whether it is decoration, information or a control. That depends on where it is used. This page is about designing icons. If you are using them in a product, read the Accessibility guide.

Core requirements

  • An icon must not be the only indication of an important action when its meaning is ambiguous.
  • Interactive controls must have an accessible name.
  • Decorative icons should be hidden from assistive technology.
  • Color must not be the only carrier of essential meaning.
  • Icons must stay distinguishable against their backgrounds.
  • Icon-only controls must have an adequate target for the product’s requirements.

What the library takes care of

The packages implement the first, second and third rules for you:

  • Icons render decorative by default: aria-hidden="true" in the web packages, hidden from VoiceOver and TalkBack in React Native, and toSvg() without a title.
  • Add aria-label (React, Vue, web component) or accessibilityLabel (React Native) and the icon becomes a named image, with role="img".
  • toSvg(name, { title }) adds a title element and role="img".

Library assets carry no context-specific label. The page knows what an icon means here; the library does not.

What designers control

Make the meaning clear

  • Use the established metaphor when there is one. See How to pick the right icon.
  • Keep the silhouette recognisable, and keep essential features.
  • Check the icon cannot be mistaken for another action next to it.
  • When meaning is not obvious, recommend a text label.

Do not rely on color

Icons inherit color. A duotone icon uses a lighter second tone for hierarchy, and it must stay understandable if that tone is lost or changed. Check each icon in one tone, and in high-contrast contexts.

Do not use opacity alone to carry a distinction, and do not draw two icons that differ only in color.

Keep shapes distinguishable

State is better carried by shape than by color: check-circle against x-circle, bell against bell-slash. Variants like these exist for that reason.

Culture and cognition

Metaphors are not universal. Consider language and region, how familiar the object is, symbols that look like other actions, and whether a label is needed. Check hand gestures, animals, mailboxes, check marks and religious or political symbols particularly carefully.

Contrast

Graphics needed to identify a control, or that carry information, should meet at least 3:1 against their background (WCAG 2.2, 1.4.11). Whether that holds is decided by the product’s colors, not by the icon.

Target size

The icon’s size and the control’s target are different. The control, not the SVG, has to meet the product’s target-size requirement (at least 24 by 24 CSS pixels in WCAG 2.2 AA; 44 by 44 points on touch is better). Making an icon larger does not make a target larger.

Mirroring

Direction matters in right-to-left layouts. Icons that point (arrows, chevrons, back and forward) are meant to be mirrored; the mirrored prop does it. Icons of real objects and brand marks are not.

Motion

Static icons are the default. If a product animates an icon: keep it purposeful and restrained, do not let meaning depend on the animation, respect reduced-motion preferences, and avoid flashing.

Review

Before accepting an icon, check that:

  • the intended meaning is clear;
  • the icon does not depend on color;
  • the metaphor is not needlessly ambiguous;
  • decorative and informative use can both be implemented correctly;
  • contrast and target size can be handled at the component level.

The library’s responsibilities are clear artwork, no reliance on color, preserved negative space, and no baked-in labels. The product’s are deciding decorative or informative, supplying names, using the right button and link semantics, focus and keyboard behaviour, contrast, target size, and announcing state.

References