Copy to clipboard
No results found.
Suggestions
Calendar
Search
Calculator
Settings
Profile ⌘P
Billing ⌘B
Settings ⌘S
Installation
Copy to clipboard
npx bearnie add command
npx bearnie add command
bunx bearnie add command
bunx bearnie add command
pnpm dlx bearnie add command
pnpm dlx bearnie add command
yarn dlx bearnie add command
yarn dlx bearnie add command
Copy to clipboard
import Command from "@/components/ui/command/Command.astro";
import CommandInput from "@/components/ui/command/CommandInput.astro";
import CommandList from "@/components/ui/command/CommandList.astro";
import CommandEmpty from "@/components/ui/command/CommandEmpty.astro";
import CommandGroup from "@/components/ui/command/CommandGroup.astro";
import CommandItem from "@/components/ui/command/CommandItem.astro";
import CommandSeparator from "@/components/ui/command/CommandSeparator.astro";
import CommandShortcut from "@/components/ui/command/CommandShortcut.astro";
Usage
import {
Command,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandItem,
CommandSeparator,
CommandShortcut,
} from "@/components/ui/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
Copy to clipboard
No results found.
Apple
Banana
Cherry
Orange
Strawberry
With groups
Copy to clipboard
No results found.
Fruits
Apple
Banana
Orange
Vegetables
Carrot
Broccoli
Spinach
Dialog
Copy to clipboard
No results found.
Suggestions
Calendar
Search
Calculator
Settings
Profile
Billing
Settings
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.