bearnie

Command

A command menu for search and quick actions.

Suggestions
Calendar
Search
Calculator
Settings
Profile⌘P
Billing⌘B
Settings⌘S

Installation

npx bearnie add command
npx bearnie add command

Usage

import {
  Command,
  CommandInput,
  CommandList,
  CommandEmpty,
  CommandGroup,
  CommandItem,
  CommandSeparator,
  CommandShortcut,
} from "@/components/bearnie/command"
<Command class="max-w-md rounded-lg border">
  <CommandInput placeholder="Search..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Actions">
      <CommandItem>Action 1</CommandItem>
      <CommandItem>Action 2</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Examples

Basic

Apple
Banana
Cherry
Orange
Strawberry

With groups

Fruits
Apple
Banana
Orange
Vegetables
Carrot
Broccoli
Spinach

Dialog

Keyboard navigation

  • Arrow Up/Down - Navigate between items
  • Enter - Select the focused item
  • Escape - Close dialog or blur input
  • Cmd/Ctrl + K - Open command dialog (when using CommandDialog)

Props

Command

Root container that manages filtering and keyboard navigation.

Prop Type Default Description
class string - Additional CSS classes

CommandInput

Prop Type Default Description
placeholder string “Search…” Input placeholder text

CommandGroup

Prop Type Default Description
heading string - Group heading text

CommandItem

Prop Type Default Description
value string - Value returned on selection
disabled boolean false Disable the item

CommandEmpty

Displayed when no items match the search query.

CommandSeparator

Visual divider between groups.

CommandShortcut

Displays keyboard shortcut hint, aligned to the right.