Components

Command palette

A ⌘K palette in liquid light: it drops in over a blurred page, the list springs to fit its results, matched letters glow and a liquid highlight slides between commands.

Paste it into ChatGPT, Claude, Cursor or v0.

Usage

React
import { CommandPalette, toast } from '@vizzele/react';

// Mount it once. ⌘K / Ctrl+K opens it from anywhere.
<CommandPalette
  items={[
    { label: 'New file', group: 'File', shortcut: '⌘N', icon: <FileIcon />, onSelect: newFile },
    { label: 'Open recent', group: 'File', onSelect: openRecent },
    {
      label: 'Toggle theme',
      group: 'View',
      keywords: ['dark', 'light'],
      description: 'Switch between deep space and pearl paper',
      onSelect: toggleTheme,
    },
    { label: 'Delete project', group: 'Danger', disabled: true },
  ]}
/>

// Or control it yourself
const [open, setOpen] = useState(false);
<Button onClick={() => setOpen(true)}>Search</Button>
<CommandPalette open={open} onOpenChange={setOpen} items={items} />

Props

PropTypeDefaultDescription
itemsCommandItem[]—{ label, onSelect?, group?, description?, icon?, shortcut?, keywords?, disabled?, id? }
open / defaultOpen / onOpenChangeboolean—Controlled or uncontrolled.
hotkeystring | false'k'Key that toggles it with ⌘ or Ctrl. false turns the shortcut off.
placeholderstring'Type a command or search…'Search field placeholder (also its accessible name).
emptyReactNode | (query) => ReactNode—Shown when nothing matches.
keepOpenbooleanfalseStay open after running a command.
footerReactNode | null—Replaces the keyboard hints; null hides the footer.

Accessibility

  • A modal dialog: focus moves to the search field, Tab is trapped, Escape closes and focus returns to whatever was focused before.
  • The field is a combobox controlling a listbox, with aria-activedescendant — screen readers announce the active command as you arrow.
  • ↑/↓ move (disabled commands are skipped), Enter runs. Reduced motion: no drop-in, cascade or height spring.