cmdk is completely unstyled — no stylesheet is included with the package. Every component exposes aDocumentation 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-* data attribute that you can target directly in CSS, giving you full control without specificity battles or class name collisions.
CSS selectors
Every part of the command menu is addressable via a data attribute:| Selector | Description |
|---|---|
[cmdk-root] | The root Command component |
[cmdk-input] | The search input |
[cmdk-list] | The scrollable list container |
[cmdk-item] | Each item in the list |
[cmdk-item][data-selected] | The currently selected item |
[cmdk-item][data-disabled] | A disabled item |
[cmdk-group] | A group container |
[cmdk-group-heading] | The heading text inside a group |
[cmdk-group][hidden] | A group hidden by filtering |
[cmdk-separator] | A visual separator between items |
[cmdk-empty] | Shown automatically when no results match |
[cmdk-loading] | Shown while async items are loading |
[cmdk-dialog] | The Command.Dialog content element |
[cmdk-overlay] | The Command.Dialog backdrop overlay |
Animating list height
Command.List sets a --cmdk-list-height CSS variable on itself, updated via a ResizeObserver as items filter in and out. Use it to animate the height smoothly:
Scroll padding
To keep items from being flush with the edge of the viewport when scrolling, usescroll-padding:
className and forwarded props
All cmdk components accept aclassName prop and forward all standard div/input props to the underlying element. You can apply utility classes from Tailwind, CSS Modules, or any other system:
Example: Vercel-style stylesheet
Below is an adapted version of the Vercel example stylesheet showing how the data attributes map to real styles:Groups are never removed from the DOM when filtered out — the
hidden attribute is applied instead. If you use display: flex on a group container, make sure to handle [cmdk-group][hidden] { display: none; } explicitly.Example stylesheets
The cmdk repository includes several drop-in stylesheets you can use as starting points:- Vercel — Clean, minimal, light/dark —
website/styles/cmdk/vercel.scss - Raycast — Polished with animated borders —
website/styles/cmdk/raycast.scss - Linear — Dense, keyboard-focused —
website/styles/cmdk/linear.scss - Framer — Motion-heavy transitions —
website/styles/cmdk/framer.scss
