Join our Discord Community

Command

React command palette with fuzzy search, keyboard shortcuts, and dialog support. Perfect for app navigation, search interfaces, and power user workflows.

Building a command palette that feels like VS Code or Linear? Users love hitting ⌘K to instantly search and navigate. The Command component delivers that smooth, fast experience with fuzzy search, keyboard navigation, and the flexibility to work as both an inline menu and modal dialog.

Loading component...

Built on cmdk by pacocoursey - the same library powering command palettes in top developer tools.

npx shadcn@latest add command

Command patterns that users expect

Quick search and navigation

The classic inline command menu for filtering through options:

Loading component...

Global command palette

Hit a shortcut key to open a full-screen command interface:

Loading component...

Smart search with filtering

Let users search through dynamic content with instant results:

Loading component...

Replace traditional select dropdowns with searchable command interfaces:

Loading component...

What components can you use?

Main Components

ComponentWhat it does
CommandRoot container that handles search and keyboard navigation
CommandInputSearch input with built-in icon
CommandListScrollable container for all menu items
CommandItemIndividual selectable menu item
CommandEmptyShows when no search results found
CommandGroupGroups related items with optional heading
CommandSeparatorVisual divider between sections

Dialog & Advanced

ComponentWhat it does
CommandDialogFull-screen command palette with backdrop
CommandShortcutDisplays keyboard shortcuts like ⌘K

Command best practices

What makes command palettes feel fast and intuitive:

  • Use clear action verbs - "Create Project" instead of "New"
  • Group logically - Navigation, Actions, Settings as separate sections
  • Show keyboard shortcuts - Display ⌘K, ⌘N to help power users
  • Handle empty states - "No results found" when search returns nothing
  • Keep search fast - Debounce API calls, filter locally when possible
  • Test keyboard navigation - Arrow keys, Enter, Escape should all work
  • Make shortcuts discoverable - Show the ⌘K shortcut somewhere in your UI
  • Return focus properly - When closing dialog, focus goes back to trigger