--- title: Command description: Fast, composable, unstyled command menu for React. component: true links: doc: https://cmdk.paco.me source: shadcn: true --- ## About The `` component uses the [`cmdk`](https://cmdk.paco.me) component by [pacocoursey](https://twitter.com/pacocoursey). ## Installation CLI Manual ```bash npx shadcn-ui@latest add command ``` Install the following dependencies: ```bash npm install cmdk ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from '@/components/ui/command' ``` ```tsx No results found. Calendar Search Emoji Calculator Profile Billing Settings ``` ## Examples ### Dialog To show the command menu in a dialog, use the `` component. ```tsx export function CommandMenu() { const [open, setOpen] = React.useState(false) React.useEffect(() => { const down = (e: KeyboardEvent) => { if (e.key === 'k' && (e.metaKey || e.ctrlKey)) { e.preventDefault() setOpen((open) => !open) } } document.addEventListener('keydown', down) return () => document.removeEventListener('keydown', down) }, []) return ( No results found. Calendar Search Emoji Calculator ) } ``` ### Combobox You can use the `` component as a combobox. See the [Combobox](/docs/components/combobox) page for more information.