Skip to content

Accessibility

Components target WCAG 2.2 AA: full keyboard operation, visible focus, 48px touch targets, prefers-reduced-motion, RTL support, and screen-reader names required by the types where one is needed.

Commitments

  • Keyboard operation and a visible focus indicator on every interactive element.
  • 48px touch targets even for extra-small visuals — for example XS and S buttons wrap a 48px touch target while their layout height stays 32 / 40px.
  • prefers-reduced-motion removes non-essential movement (see the Motion guide).
  • Right-to-left layouts via logical properties, so components mirror automatically.
  • Accessible names required by the component types wherever one is needed.

Focus rings

Focus rings are a CSS outline with outline-offset (the focus-ring / focus-ring-inset utilities), so an overflow-hidden on the component itself can't clip them. The inset ring is drawn inside the element, for full-bleed items such as list rows, where an ancestor that clips its overflow would cut off an outer ring.

Names the types require

These components won’t type-check without an accessible name, so the requirement can’t be forgotten:

ComponentRequired name
IconButton, Fab, FabMenuaria-label or aria-labelledby
TextFieldlabel, or aria-label / aria-labelledby
Checkbox, Radio, Switcha label (children), or aria-label / aria-labelledby
RadioGrouplabel, or aria-label / aria-labelledby
Toolbars (Docked / Floating)aria-label or aria-labelledby
List, ChipSet, Carouselaria-label or aria-labelledby
Slider, RangeSlideraria-label or aria-labelledby
NavigationRail, NavigationBararia-label or aria-labelledby
SearchBararia-label or aria-labelledby
SearchFieldaria-label or aria-labelledby
BottomSheetaria-label or aria-labelledby
SideSheettitle, or aria-label / aria-labelledby
Linear / Circular progress, LoadingIndicatoraria-label or aria-labelledby
naming.tsx
import { IconButton, TextField } from '@windmorph/react';

// Icon-only buttons require a name — the types enforce aria-label OR aria-labelledby.
<IconButton variant="standard" icon={<SearchIcon />} aria-label="Search" />;

// A TextField needs a visible label OR aria-label / aria-labelledby.
<TextField label="Email" type="email" />;
<TextField aria-label="Search" />;

Keyboard behaviour

A per-family summary. Detailed per-component tables live on the individual component pages.

ComponentKeys
MenuArrow keys move, typeahead jumps, Esc or an outside press dismisses, focus returns to the trigger.
ButtonGroup (single select)Renders a radiogroup; Tab enters and leaves the group as one stop, and arrow keys move between options.
TabsArrow keys plus Home / End move focus; Space or Enter selects the focused tab (keyboardActivation="automatic" selects on focus).
DialogFocus is contained while open and returns to the trigger on close; Esc closes it and an outside press closes it too, except for an alertdialog (the default role); closedBy, as the HTML dialog's closedby, changes which of them may close it.
TooltipShows on hover or keyboard focus, stays while focused, and Esc hides it.
SliderArrow keys adjust the value; Home / End jump to the ends.

Right-to-left

Components use logical properties, so they mirror in RTL. React Aria, though, takes keyboard direction (arrow keys, start / end) from its locale rather than the DOM dir. DomDirectionLocale bridges that gap and is used internally by Toolbar, ButtonGroup, Slider, DatePicker, DateField and List. It lives in @windmorph/react/primitives, shown here for reference.

rtl.tsx
import { DomDirectionLocale, localeWithDirection } from '@windmorph/react/primitives';

// React Aria takes keyboard direction from its locale, not the DOM dir. DomDirectionLocale
// reads an element's computed direction and, when it differs from the locale, supplies a
// same-language locale with the matching script (en-US -> en-Arab-US for RTL, ar -> ar-Latn
// for LTR) that keeps its hour cycle and calendar (zh-Hant-TW -> zh-Arab-TW-u-hc-h12). Its
// digits are the new script's (ar-EG -> ar-Latn-EG), so React Aria inputs there read Latin
// ones. The components inside still write and read dates, times and numbers in the page's locale,
// which useLocale() gives your own formatting there.
<DomDirectionLocale>
  {(directionRef) => <ul ref={directionRef}>{/* list items */}</ul>}
</DomDirectionLocale>;

// localeWithDirection('en-US', 'rtl') -> 'en-Arab-US'