Skip to content

CommandPalette

Keyboard-first command menu (⌘K).

Import

tsx
import { ZCommandPalette } from "@zurto/ui";

Usage

tsx
<ZCommandPalette
  open={open}
  onClose={() => setOpen(false)}
  commands={[
    { id: "new", label: "New File", shortcut: "⌘N", action: createFile },
    { id: "save", label: "Save", shortcut: "⌘S", action: save },
  ]}
/>

Props

PropTypeDefaultDescription
openbooleanfalseOpen state
onClose() => voidClose handler
commandsCommand[][]Available commands
placeholderstring'Search...'Search placeholder

Released under the MIT License.