Accessibility

Every component is built to WCAG AA: native elements first, the WAI-ARIA pattern where there is one, complete keyboard use, visible focus that is never trapped, and every page checked by axe in light and dark. What it can't know — the words — is yours.

Native elements first

A part is an attribute on your element — a button, an input, a header, a ul — so it keeps what the browser gives it: its role, its focus, its form behaviour. A checkbox is a real checkbox, a switch a real one with role="switch", an OTP input one real input per character. ARIA is added only where HTML has nothing (a menu, a combobox, a tree), following the WAI-ARIA Authoring Practices.

The keyboard

Everything a pointer does, the keyboard does: Tab to reach a widget, the arrows within it (mirrored right to left), Home and End to its ends, Enter or Space to act, Escape to close and give the focus back. A composite widget (a toolbar, a radio group, a menu bar) is one tab stop. Each component's page lists its keys.

Focus

Focus is always visible (the style's ring) and goes where you expect: into a dialog when it opens, back to its trigger when it closes. A modal dialog keeps the focus inside while it is open; a popover, a menu or a mobile menu doesn't trap it — leaving closes them.

Names are yours

The library writes no text: every label, button name and message is in your template, in your language. An icon-only button gets its name in a visually hidden span — read by screen readers, kept in the button's text for translation and voice control. In development, a part left without a name warns in the console.

<button scButton size="icon" variant="ghost">  <svg siTrashIcon></svg>  <span class="sr-only">Delete the file</span></button>

Announcements

What changes without moving the focus is announced through a live region: a toast, a value stepped by a button, a sorted list. A field's errors are an alert, and are read with its control.

Motion, direction, touch

  • With reduced motion asked for, animations keep their fades and lose their movement.
  • Right to left is built in: logical sides, mirrored icons and arrow keys, from Angular's Directionality — see Right to left.
  • Targets are at least 24 px on touch screens (WCAG 2.5.8), and every component works at 360 px wide.

How it is checked

Every docs page runs axe in light and in dark mode, and every demo has end-to-end tests of its keyboard, focus and names, in Chromium, Firefox and WebKit. Contrast follows the theme: if you change its colours, keep text at 4.5:1 and controls at 3:1.