Command
Command palette / fuzzy menu. Mirrors shadcn Command. Built on cmdk.
Purpose
Command palette / fuzzy menu. Mirrors shadcn Command. Built on cmdk.
Island model
island: true. Filter state, keyboard navigation, and focus management require client JS.
Peer dependencies
cmdk@^1@radix-ui/react-dialog@^1.1(forCommandDialogvariant)lucide-react@^0.400
Public API
export function Command(props: React.ComponentProps<typeof CommandPrimitive>): JSX.Element
export function CommandDialog(props: { open?: boolean; onOpenChange?: (o: boolean) => void; children?: React.ReactNode }): JSX.Element
export function CommandInput(props: React.ComponentProps<typeof CommandPrimitive.Input>): JSX.Element
export function CommandList(props: React.ComponentProps<typeof CommandPrimitive.List>): JSX.Element
export function CommandEmpty(props: React.ComponentProps<typeof CommandPrimitive.Empty>): JSX.Element
export function CommandGroup(props: React.ComponentProps<typeof CommandPrimitive.Group>): JSX.Element
export function CommandItem(props: React.ComponentProps<typeof CommandPrimitive.Item>): JSX.Element
export function CommandShortcut(props: React.ComponentProps<"span">): JSX.Element
export function CommandSeparator(props: React.ComponentProps<typeof CommandPrimitive.Separator>): JSX.Element
export const island = true
Patties adjustments
CommandDialogwraps the palette in a Radix Dialog so thatCmd+Kglobal trigger can mount a modal.- The
Cmd+K/Ctrl+Kglobal hotkey is not registered automatically; userland binds it in an island. - Removes
forwardRef.
Acceptance criteria
- Typing filters items via
cmdk. ↑/↓/Enter/Escnavigate and select.CommandDialogtraps focus while open and restores on close.- Items can declare
valuedistinct from their visible label for stable filtering.