WCAG 2.1 AA — release blocker
Command must satisfy these on every render before it ships.
Web (React DOM)
- Root has
role="listbox"witharia-label. - Each
CommandItemhasrole="option"witharia-selectedon the highlighted item. CommandInputis linked to the listbox viaaria-controls.- Groups use
role="group"witharia-labelledbypointing to the heading. - Empty state is announced as a live region.
Keyboard
| Key | Action |
|---|---|
Arrow Up/Down | Move highlight through items. |
Enter | Select the highlighted item. |
Escape | Close dialog (in CommandDialog mode). |
⌘K / Ctrl+K | Toggle dialog open (app-level binding). |
Dialog mode
CommandDialog wraps the component in a Dialog, inheriting all dialog accessibility — focus trap, Escape to close, scroll lock.
React Native
- Command is a stub on native (text input + flat list).
Audit checklist
- Input linked to results via
aria-controls - Arrow keys navigate items without losing input focus
- Selected item announced with
aria-selected - Empty state announced to screen readers
- Dialog traps focus when open
- Escape closes dialog