110k
New

Command

Command menu for search and quick actions.

Component command-demo not found in registry.

About

The <Command /> component uses the cmdk component by Dip.

Installation

pnpm dlx createui@latest add command

Usage

import {
  Command,
  CommandDialog,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
  CommandShortcut,
} from "@/components/ui/command"
<Command className="max-w-sm rounded-lg border">
  <CommandInput placeholder="Type a command or search..." />
  <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>

Examples

Basic

A simple command menu in a dialog.

Component command-basic not found in registry.

Shortcuts

Component command-shortcuts not found in registry.

Groups

A command menu with groups, icons and separators.

Component command-groups not found in registry.

Scrollable

Scrollable command menu with multiple items.

Component command-scrollable not found in registry.

API Reference

See the cmdk documentation for more information.