Patterns

CommandPalette

An exportable cmdk-based palette with a real index of docs, routes, actions, shortcuts, and keywords.

installnpx shadcn@latest add https://ds.bartoszrychlicki.com/r/br-command-palette.json

Preview

BR-UI command palette

Search BR-UI docs and run quick actions.

import { CommandPalette, type CommandPaletteItem } from "@/components/br/command-palette";

const items: CommandPaletteItem[] = [
  { id: "clients", label: "Open clients", group: "Navigation", href: "/clients" },
  { id: "invoice", label: "Create invoice", group: "Actions", action: createInvoice },
];

<CommandPalette open={open} onOpenChange={setOpen} items={items} />

Props

PropTypeDefaultDescription
itemsCommandPaletteItem[]Searchable commands grouped by label.
hrefstringNavigate after selection.
action() => voidRun local action after selection.
keywordsstring[]Additional fuzzy-search terms.