Accessibility
How YolkUI components work with a keyboard, screen readers, WCAG AA contrast, right to left and Windows High Contrast, how I test them, and the known gaps.
What you get
YolkUI builds on Base UI, which handles the parts that are hardest to get right: ARIA roles and states, keyboard support from the WAI-ARIA Authoring Practices, and focus that moves where it should. On top of that, every component goes through the checks on this page before it goes up. Nothing here is a certification, and I list the gaps I know about near the end.
Keyboard and screen readers
Every component works with a keyboard alone and tells a screen reader what it is, what state it's in and what it's called. A test runs each example on these pages through the WAI-ARIA pattern of every widget it holds: the roles, the Tab stops and the arrow keys. In development, a component warns in the console when nothing gives it a name.
Focus
Focus shows as a 2px outline in --ring, 2px away from the control, and it appears at once rather than fading in. It's an outline, not a box shadow, because Windows High Contrast mode removes shadows and the focus would vanish with them.
Contrast
Every text color passes WCAG AA, 4.5:1 on its fill, in light and in dark. Focus outlines, chart colors and other marks that must stand out from the page pass 3:1. A test reads the theme and checks every pair whenever a value changes, and Theming shows each number.
Disabled controls
A disabled button, checkbox, tab or menu item stays in the Tab order with aria-disabled, so a keyboard user can still reach it and a tooltip can say why it's off. It fades to 60% and still responds to hover, so the tooltip opens. Input, Native Select, Combobox and Slider use the browser's own disabled state instead, which Tab skips, so their pages put the reason in a FieldDescription, where everyone can read it.
Color is never the only signal
Each status has words or an icon as well as a color. An invalid field shows its error message, an Alert and a Toast draw an icon for their type, and a Badge says what it means in its label.
Windows High Contrast
In forced colors mode the system replaces every color. Components draw a border wherever their edge was a fill or a shadow, mark the selected item in the system's highlight color, and use the system's gray for disabled controls in place of the fade.
Right to left
Components use logical properties (start and end, never left and right), so they mirror themselves for Arabic, Hebrew and Persian. Arrow keys and popups follow Base UI's DirectionProvider, so wrap your app in it beside dir="rtl".
import { DirectionProvider } from "@base-ui/react/direction-provider"
export default function App({ children }) {
return (
<DirectionProvider direction="rtl">
<div dir="rtl">{children}</div>
</DirectionProvider>
)
}Reduced motion
When the system asks for reduced motion, popups fade without the zoom, the selection in Tabs and Segmented Control moves without sliding, and a loading spinner turns more slowly.
Phones and touch
Text in a field is 16px on small screens, so iOS Safari doesn't zoom in when you tap it. Hover colors only apply on devices that can hover, so a tap never leaves a control lit.
How I test
Every component runs through these before it goes up, and again on every change:
- axe on every component.
- WAI-ARIA patterns for every example: roles, names, Tab stops and arrow keys.
- Right to left: every horizontal widget pressed in both directions, ArrowLeft in RTL against ArrowRight in LTR.
- Contrast of every color pair in both themes, read from the theme file.
- Server rendering: every example rendered on a server and hydrated in a browser with another locale and time zone, with no mismatch.
- Browsers: Playwright in Chromium, Firefox, WebKit and an iPhone profile for the first components, Windows High Contrast emulated in Chromium.
- VoiceOver with Safari, by hand, for several components so far.
Known gaps
Where YolkUI falls short today:
- The soft ring around a field and the selected state in Tabs, Toggle and Pagination are about 1.2:1 against the page, under the 3:1 that WCAG 1.4.11 asks for. shadcn/ui makes the same trade. A project that needs strict compliance can raise
--inputand the selected fills in its theme. - I haven't checked NVDA or JAWS on Windows yet, and VoiceOver hasn't covered every component.
- The newer components don't have browser tests yet. A full pass across browsers and real devices comes before version 1.0.
Your part
A component can only be as accessible as the content you give it:
- Give every field a label, with Field or Label.
- Give an icon-only button an
aria-label. - Write alt text for images that carry meaning, and
alt=""for decoration. - If you change a color token, check its text still reaches 4.5:1 in both themes.
- Keep the focus outline. If you restyle it, keep it visible and keep it an outline.
- When a control is disabled, say why, in a tooltip or a description.