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.Group wraps a set of Command.Item components under a shared heading. When the user searches, the group — including its heading — is hidden if none of its items match. Groups are never unmounted; they are hidden using the hidden HTML attribute.
[cmdk-group]— always present on the group container[cmdk-group-heading]— present on the heading elementhidden— applied to the group element when all its items are filtered out
Groups use the
hidden HTML attribute rather than unmounting from the DOM when filtered. Keep this in mind when writing CSS — use [cmdk-group]:not([hidden]) to target only visible groups.Props
The heading content displayed above the group’s items. Rendered in a
[cmdk-group-heading] element. Set aria-hidden automatically so it doesn’t interfere with listbox accessibility semantics.A unique identifier for the group. Required when no
heading is provided. If a heading is provided, the value is inferred from the heading’s text content. Used internally for sorting groups by their highest-scoring item.When
true, the group and all of its items are always rendered regardless of the current search query. The hidden attribute is never applied. Also propagates to child Command.Item components.Examples
Group with heading
Group without heading
When you omit the heading, provide a uniquevalue so cmdk can track the group internally:
Styling visible groups
Because groups usehidden instead of unmounting, target only visible groups explicitly:
Always-visible group
UseforceMount to keep a group visible regardless of what the user is searching for:
