GitHub 560+

Command

Command menu for search and quick actions.

Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile ⌘P
Billing ⌘B
Settings ⌘S

Installation

npx shadcn@latest add @fulldev/command

Usage

import {
  Command,
  CommandDialog,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
  CommandShortcut,
} from "@/components/ui/command"
<Command class="ring-foreground/10 max-w-sm rounded-lg ring-1">
  <CommandInput placeholder="Search commands..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Suggestions">
      <CommandItem>Calendar</CommandItem>
      <CommandItem>Search Emoji</CommandItem>
      <CommandItem>Calculator</CommandItem>
    </CommandGroup>
    <CommandSeparator />
    <CommandGroup heading="Settings">
      <CommandItem>Profile</CommandItem>
      <CommandItem>Billing</CommandItem>
      <CommandItem>Settings</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Composition

Use the following composition to build a Command:

Command
├── CommandInput
└── CommandList
    ├── CommandEmpty
    ├── CommandGroup
    │   ├── CommandItem
    │   └── CommandItem
    ├── CommandSeparator
    └── CommandGroup
        ├── CommandItem
        └── CommandItem

Examples

Basic

A simple command menu in a dialog.

Quick actions
Send email ⌘E
Deploy project ⌘D
Open settings ⌘,
Keyboard shortcuts ?

With Groups

A command menu with groups, icons and separators.

Suggestions
Calendar
Notes
Projects
Account
Profile
Billing
Settings
API Keys

Many Groups & Items

Scrollable command menu with multiple items.

Recent
Recent search 1
Recent search 2
Recent search 3
Recent search 4
Recent search 5
Recent search 6
Recent search 7
Recent search 8
Recent search 9
Recent search 10
Recent search 11
Recent search 12
Recent search 13
Recent search 14
Recent search 15
Recent search 16
Recent search 17
Recent search 18

API Reference

See the GitHub source code for more information on props. See the data-slot docs for more information on interactivity.