CommandPalette

Modal Cmd-K palette with grouped commands, fuzzy filter, and full keyboard navigation (arrows, Enter, Escape).

Preview

Usage

import { CommandPalette } from '@ramtt/ui'

<CommandPalette
  open={open}
  onOpenChange={setOpen}
  groups={[{ label: 'Actions', items: [{ id: 'new', label: 'New project' }] }]}
  onSelect={(item) => run(item)}
/>

Props

PropTypeDefaultDescription
open*booleanControls visibility
onOpenChange*(open: boolean) => voidOpen-state setter
groups*CommandGroup[]Grouped command items
onSelect*(item: CommandItem) => voidCalled when a command is chosen
placeholderstring'Search...'Input placeholder
classNamestringAdditional Tailwind classes on the dialog