Command

Forms

Fast, composable, unstyled command menu for React.

Import

import { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut } from "@/components/ui/command";

Usage

Default

A standard command menu with search, groups, and items.

Dialog

Command menu inside a dialog, triggered by a keyboard shortcut.

Press ⌘K

API Reference

filter—
(value: string, search: string) => number

Custom filter function for items

loop—
boolean

Whether to loop selection at the end of the list

open—
boolean

Controlled open state for dialog

onOpenChange—
(open: boolean) => void

Event handler for open state change