Command
Provides a fast, keyboard-friendly command or search menu.
Installation
Install Command from Oros with shadcn CLI 4.13.0.
pnpm dlx shadcn@4.13.0 add @oros/commandUsage
import {
Command,
CommandDialog,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
} from "@/components/ui/command"Open the Source tab in the preview for a complete working example.
Anatomy
| Export | Responsibility |
|---|---|
| Command | The root component that owns the primary structure and state. |
| CommandDialog | A composable part of the component anatomy. |
| CommandInput | Captures or exposes the current value. |
| CommandList | A composable part of the component anatomy. |
| CommandEmpty | A composable part of the component anatomy. |
| CommandGroup | Groups related items into one logical set. |
| CommandItem | Represents one option or repeated child. |
| CommandShortcut | A composable part of the component anatomy. |
| CommandSeparator | Visually and semantically separates related groups. |
API Reference
Command exports 9 named entries. Component exports accept the props of their underlying HTML element or Base UI component, plus an optional className, unless the source defines a more focused type.
CommandComponentCommandDialogComponentCommandInputComponentCommandListComponentCommandEmptyComponentCommandGroupComponentCommandItemComponentCommandShortcutComponentCommandSeparatorComponent
Accessibility
- Command inherits focus management and keyboard support from Base UI; keep the provided trigger and content parts together.
- Give icon-only triggers an accessible name, retain visible focus styles, and verify Escape and focus-return behavior in the final composition.
Source
Command uses the standard shadcn API and is distributed through Oros. Installing it adds the component source and required dependencies to your app. The Source tab above shows a complete usage example.