Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dip/cmdk/llms.txt
Use this file to discover all available pages before exploring further.
cmdk is fully React Strict Mode safe. If you encounter any issues in Strict Mode, open an issue on GitHub.
Create a basic command menu
Import
Command and compose the sub-components to build your menu. cmdk filters and sorts items automatically as the user types.Commandis the root component and renders inline wherever you place it.Command.Inputis the search field. It controls filtering automatically.Command.Listcontains all items and groups.Command.Emptyrenders automatically when no items match the search query.Command.Groupgroups items under a visible heading.Command.Separatoris hidden when the user is searching, visible when the query is empty.
Add dialog support
Use
Command.Dialog to render the menu in an accessible overlay. Toggle it with a keyboard shortcut.Command.Dialog composes Radix UI’s Dialog component and renders an overlay. The open and onOpenChange props give you full control over when the menu is visible. cmdk does not listen for keyboard shortcuts automatically — you wire them up yourself so you have complete control over the keybind context.Style it
cmdk ships with no default styles. Every element exposes a The
cmdk-* data attribute that you can target with plain CSS.--cmdk-list-height CSS variable is updated automatically by Command.List and reflects the height of the current results. Use it to animate the list height smoothly as results change.For a complete reference of all available data attributes and styling patterns, see the styling guide.