Command

Filterable command palette with grouped items, shortcuts, and keyboard navigation. Render inline or inside a modal CommandDialog (⌘K style).

File
New file⌘ N
Open file…⌘ O
Save⌘ S
Preferences
Toggle theme
Open settings

Usage

import { Command, CommandDialog } from '@bwo-ui/react';

const items = [
  { id: 'new',   label: 'New file', group: 'File', shortcut: '⌘N', onSelect: newFile },
  { id: 'save',  label: 'Save',     group: 'File', shortcut: '⌘S', onSelect: save },
];

<CommandDialog open={open} onOpenChange={setOpen}>
  <Command items={items} />
</CommandDialog>

Props — Command

PropTypeDefaultDescription
itemsCommandItemEntry[]Items (grouped by their group field).
placeholderstringSearch input placeholder.
filter(item, query) => booleanCustom matcher (default: case-insensitive across label + keywords).
emptyStateReactNodeRendered when no items match.
searchstringControlled search input value.
onSearchChange(s: string) => voidSearch change handler.

Props — CommandDialog

PropTypeDefaultDescription
openbooleanControlled open state.
onOpenChange(open: boolean) => voidOpen change handler.
titlestring'Command Palette'Accessible (screen-reader-only) title.