OPUS/UI

Navigation

Command

hot

⌘K command palette with fuzzy ranking, match highlighting, groups, shortcuts and a `useHotkey` helper.

5 files · 517 locdeps: clsx, tailwind-merge
or press Ctrl/⌘J

Last action: nothing yet

Command palette

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/command.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs command

Usage

import { CommandDialog, useHotkey } from "@/components/opus/ui/command";

useHotkey("mod+k", () => setOpen((o) => !o));
<CommandDialog open={open} onOpenChange={setOpen} items={items} />

API

PropTypeDefaultDescription
itemsCommandItem[]—{ id, label, group?, keywords?, icon?, hint?, shortcut?, onSelect }
initialItemsCommandItem[]—Curated list shown before the user types.
placeholderstring—Input placeholder.
limitnumber50Max ranked results.
footerReactNode—Hint bar under the list.

Command palette