Skip to main content
Command.Separator renders a visual and semantic separator (using role="separator") between items or groups. By default it is only visible when the search query is empty — it hides as soon as the user starts typing, so it doesn’t clutter search results. Pass alwaysRender to keep it visible regardless of the search state.
Data attribute: [cmdk-separator]

Props

boolean
default:"false"
When true, the separator is rendered even when the user has typed a search query. By default, separators are only rendered when the search input is empty.
All other div props are forwarded to the underlying element.

Behavior

The separator renders when either of these conditions is true:
  • The search query is empty (default behavior)
  • alwaysRender is true
When neither condition is met, the component returns null — it is fully removed from the DOM, not just hidden.

Styling

Examples

Always-visible separator

Use alwaysRender sparingly. Separators that persist during search can make filtered results look fragmented.