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.Empty renders its children only when the filtered item count drops to zero — that is, when the user has typed a search query that matches no items. It disappears automatically as soon as any item becomes visible.
[cmdk-empty]
Props
Command.Empty accepts all standard div props and forwards them to the underlying element. There are no cmdk-specific props.
Behavior
Command.Empty subscribes to the filtered item count in the cmdk store. It renders when filteredCount === 0 and returns null otherwise. It is fully unmounted (not just hidden) when items are present.
Command.Empty counts all visible items across all groups. It will render if every item is filtered out, even if forceMount items are present — because forceMount items are excluded from the filtered count.Examples
Custom empty message
Dynamic empty state using search state
Use theuseCommandState hook to show what the user searched for:
