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.
Command.Item renders a single selectable option. Items become active when the pointer enters them or when they are reached through keyboard navigation. Selecting an item (via Enter or click) fires onSelect.
Items are automatically filtered and sorted as the user types. If no value is provided, the value is inferred from the item’s text content.
[cmdk-item]— always present[data-selected]— present when the item is currently selected (focused)[data-disabled]— present when the item is disabled
Props
A unique value for this item, used for filtering, sorting, and selection state. If omitted, cmdk infers the value from the item’s
children text or rendered textContent. Must be stable if your text content changes between renders.Callback fired when the item is selected, either by pressing
Enter while it is focused or by clicking it. Receives the item’s value string.When
true, the item is not selectable by keyboard or pointer. It remains in the DOM and receives the data-disabled attribute, but onSelect will not fire.Additional search aliases for this item. Keywords are matched alongside the item’s value and can affect its sort rank. Keywords are trimmed before use.
When
true, the item is always rendered regardless of the current search query. It will not be hidden by filtering. Useful for pinned actions or static entries.Examples
Basic item with onSelect
Providing an explicit value
Always providevalue when your item content is dynamic or contains elements beyond plain text:
Keywords for better search
Add aliases so items appear for related search terms:Disabled state
Selected state styling
Target the active item with[data-selected]:
Force mount a pinned item
UseforceMount to keep a static item visible even when search produces no match for it:
