preskok/ui

Command Menu

Spotlight-style command menu with search, sections, and keyboard shortcuts.

Installation

pnpm dlx @preskok-org/ui@latest add command-menu

Usage

import { CommandMenu } from "@/registry/preskok/ui/preskok-ui/command-menu"
 
export function CommandMenuDemo() {
  return (
    <CommandMenu isOpen aria-label="Command" shortcut="k">
      <CommandMenu.Search />
      <CommandMenu.List>
        <CommandMenu.Section title="General">
          <CommandMenu.Item>Open</CommandMenu.Item>
          <CommandMenu.Item>Save</CommandMenu.Item>
        </CommandMenu.Section>
      </CommandMenu.List>
      <CommandMenu.Footer>Press ⌘K to open</CommandMenu.Footer>
    </CommandMenu>
  )
}