Command Dialog

Command dialog that opens the command palette in a modal from a list of commands with labels and handlers. Wire it to a Cmd K shortcut in your React app.

src/registry/ui/command-dialog.tsx/r/command-dialog.json

Installation#

bash
npx shadcn@latest add @minidev/command-dialog

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/command-dialog.json

Usage#

tsx
import { CommandDialog } from "@/components/ui/command-dialog"

export function Example() {
  return <CommandDialog />
}

API reference#

CommandDialog props
PropTypeDefault
openboolean-
onOpenChange(o: boolean) => void-
commandsCommand[]SAMPLE_COMMANDS

Dependencies#

npm

lucide-react
All dialog, drawer and popover components

Learn more