cmdk
UI library · Free
An accessible React command menu with search and keyboard navigation: it provides a foundation for an application command palette.
Also known as: pacocoursey/cmdk; command-menu-react

What you can use for free
Code and local use under MIT.
Paid features and costs
Computing resources, self-hosting, and external services are paid for separately if used.
Access and limitations
Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.
Use cases
- Create a keyboard command palette
- Connect palette selection/navigation to application action execution
Example workflow
A possible workflow; this is not a report of hands-on testing.
Create a keyboard command palette.
Before you start
- The component's design, states, and data.
- A compatible framework and the project's styles.
Steps
- Define searchable commands and available actions.
- Connect palette selection/navigation to application action execution.
- Configure styles and check empty, loading, and error states.
Check your result
- The keyboard, focus indicators, and a screen reader let users complete the action.
- The component works on a narrow screen and with long data values.
Choosing cmdk
Create a keyboard command palette
Choose this when
- Create a keyboard command palette
- Connect palette selection/navigation to application action execution
Things to consider
- Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
- Terms of use: MIT for the code; dependencies have separate licenses.
- A unique value is recommended for each Command.Item; groups are hidden with the hidden attribute and remain in the DOM.
Frequently asked questions
What can you use for free in cmdk?
Code and local use under MIT.
What additional costs might arise with cmdk?
Computing resources, self-hosting, and external services are paid for separately if used.
What terms of use matter for cmdk?
MIT for the code; dependencies have separate licenses.
How do you get started with cmdk?
Define searchable commands and available actions. Connect palette selection/navigation to application action execution. Configure styles and check empty, loading, and error states.
Can I replace built-in filtering and display the command menu as a dialog?
Yes: filter defines custom ranking, keywords adds search aliases, and shouldFilter=false disables built-in filtering/sorting. Command.Dialog uses Radix Dialog and accepts a Portal container; loop wraps arrow navigation. The example's Ctrl/⌘K shortcut is handled by the application.
License
MIT for the code; dependencies have separate licenses.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsTechnologies and topics
- cmdk
- UI
- Development