Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

cmdk

Command menu component library for React applications.

UI components and iconsNPM

GitHubWebsite

1. License

License from npm.

github.com/pacocoursey/cmdk

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What cmdk does

cmdk is an unstyled React command menu where you write the items as plain composable JSX and the component filters and sorts them for you.

cmdk popularity

80 / 100
Gid Score, #101 overall
51M
downloads a week, npm
13.2K
GitHub stars
393
agent projects use it
cmdk: downloads per weeknpm, cmdk 50,963,592
cmdk: GitHub starspacocoursey/cmdk 13,189

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How cmdk is used

  • cmdk is a dependency in 393 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (8.1% of the 4,867 JavaScript/TypeScript ones), #5 of 230 in ui components and icons.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,628; those are left out of every share on this page.
  • Projects that use it most often also use Class Variance Authority (98.7%), Lucide React (98.5%), clsx (97.2%).
  • It is more common in projects set up for Roo Code (12.6%) than for Gemini CLI (4.2%).

By coding agent

228 projects, 9.3%
189 projects, 5.8%
157 projects, 5.2%
25 projects, 5.3%
23 projects, 8.2%
20 projects, 4.2%
18 projects, 5.2%
14 projects, 12.6%

Often used with

In 98.7% of its projects
In 98.5% of its projects
In 97.2% of its projects
In 96.9% of its projects
In 89.3% of its projects
In 83.5% of its projects
In 83.2% of its projects
In 79.6% of its projects

cmdk in practice

Strengths

Items can live inside your own components

The README says the API is fully composable. Items can be wrapped in other components or written as static JSX. You do not have to pass them in as a data array.

Styling hooks on every part

Every part forwards props, including <code>ref</code>, to a real element. Every part also gets a <code>cmdk-</code> data attribute such as <code>[cmdk-item]</code> or <code>[cmdk-list]</code> for CSS. The README also links drop-in stylesheets as a starting point.

Ranking you can replace

You can pass a custom <code>filter(value, search, keywords)</code> function that scores each item. Item-level <code>keywords</code> act as aliases that can affect rank. You can also turn built-in filtering off with <code>shouldFilter={false}</code>.

Accessibility checked with a screen reader

The FAQ says labeling, aria attributes and DOM ordering were tested with VoiceOver and Chrome DevTools. It also says the Dialog composes an accessible Dialog implementation.

Watch out for

No virtualization

The FAQ says cmdk does not virtualize. It reports good performance up to 2,000-3,000 items. For more, pass <code>shouldFilter={false}</code> and bring your own virtualization.

You wire up ⌘K yourself

The component does not listen for the keyboard shortcut. The README's dialog example adds its own <code>keydown</code> listener to toggle <code>open</code>.

React 18 is required

cmdk depends on React 18 hooks. The FAQ also says it is a client component, not a React server component.

A basic inline command menu

import { Command } from 'cmdk'

const CommandMenu = () => {
  return (
    <Command label="Command Menu">
      <Command.Input />
      <Command.List>
        <Command.Empty>No results found.</Command.Empty>

        <Command.Group heading="Letters">
          <Command.Item>a</Command.Item>
          <Command.Item>b</Command.Item>
          <Command.Separator />
          <Command.Item>c</Command.Item>
        </Command.Group>

        <Command.Item>Apple</Command.Item>
      </Command.List>
    </Command>
  )
}

More about cmdk

Funding
  • GitHub Sponsors: https://github.com/pacocoursey
  • 2 GitHub sponsors

See all

Packages around it
  • class-variance-authority: Component variant classes
  • lucide-react: Icon set
  • clsx: Class name joining
  • tailwind-merge: Tailwind class merging
  • @radix-ui: Headless UI primitives
  • sonner: Toast notifications
More in UI components and icons

Alternatives

cmdk This page

MITGid 8051M/wk

Compare cmdk with another tool

Get started

Install it.

npm install cmdk

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## cmdk
- Give every `Command.Item` a `key` and a unique `value`. If `value` is omitted it is inferred from `.textContent`, and values are always trimmed.
- Treat cmdk as a client component that requires React 18. Do not use it in a React server component.
- Add your own `keydown` listener for ⌘K/Ctrl+K and toggle `open` on `Command.Dialog`. cmdk does not listen for the shortcut.
- Keep `open` on `Command.Dialog` `false` during server rendering to avoid hydration mismatches.
- For lists beyond 2,000-3,000 items, pass `shouldFilter={false}`, filter yourself and add your own virtualization.
- Style through the `[cmdk-*]` data attributes. Groups are hidden with the `hidden` attribute, not unmounted.
- Use `useCommandState` only for advanced cases such as a detailed empty state. Conditionally render `Command.Loading` while async items load.