Skip to main content
cmdk is completely unstyled — no stylesheet is included with the package. Every component exposes a 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:

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, use scroll-padding:

className and forwarded props

All cmdk components accept a className 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