Skip to main content
cmdk implements the ARIA combobox pattern. All required roles, properties, and relationships are set automatically. Labeling, keyboard navigation, and focus management are tested with VoiceOver and Chrome DevTools Accessibility panel.

Providing a label

The only thing you must supply is a label prop on Command. This text is read by screen readers to identify the control — it is never shown visually.
If you omit label, screen readers will announce the control without a meaningful name. Always provide a descriptive label.

ARIA attributes set automatically

cmdk sets all required ARIA attributes so you don’t have to think about them.

Input

The Command.Input renders as an <input> with:

List

Command.List renders as a <div> with:

Items

Each Command.Item renders as a <div> with:

Groups

Command.Group uses a two-layer structure:
  • The outer container has role="presentation"
  • The inner items container has role="group" and aria-labelledby pointing to the heading
  • The heading itself has aria-hidden="true" — it is referenced by aria-labelledby, not read redundantly

Command.Dialog

Command.Dialog wraps Radix UI Dialog, which is fully accessible out of the box. It manages focus trapping, scroll locking, and the aria-modal attribute. Pass label to Command.Dialog — it is forwarded to the underlying DialogContent as aria-label:
The Dialog overlay is always rendered when Command.Dialog is open. You can style it via [cmdk-overlay] and provide a custom class with overlayClassName.

Keyboard navigation

cmdk handles all standard keyboard interactions: Vim bindings can be disabled with vimBindings={false} on Command.