🚧 VeloxKit is pre-release software. APIs may change before v1.0. Get started →
Documentation
Packages
@velox/command

@velox/command

A Cmd/Ctrl+K command palette with fuzzy matching. Register commands from anywhere in the tree; render the palette once near the root.

Install

npm install @velox/command

Usage

import { CommandPalette, useCommands } from '@velox/command'
 
function Screen() {
  useCommands([
    { id: 'new',    label: 'New Note', section: 'Notes', action: newNote },
    { id: 'search', label: 'Search',   section: 'Notes', action: search, keywords: ['find'] },
  ])
  return <CommandPalette accelerator="ctrl+k" />
}