Skip to content

Command

Navigation

Command palette (Cmd+K) with searchable list of actions and pages.

SearchGroupsEmpty resultsAction feedback
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use the inline Command with input, list, groups, and items for searchable actions. CommandDialog is also exported for modal palettes; opening shortcuts must be implemented by the application.

Import
import {
  Command,
  CommandInput,
  CommandList,
  CommandEmpty,
  CommandGroup,
  CommandItem,
  CommandSeparator,
  CommandShortcut,
} from "@dashboardpack/core/components/ui/command";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Command props
PropType / DefaultDescription
onSelect (CommandItem)(value: string) => void

Default: —

Invoked for the selected command.
value (CommandItem)string

Default: derived from text

Searchable unique value.
disabled (CommandItem)boolean

Default: false

Exclude an unavailable command from selection.
shouldFilter (Command)boolean

Default: true

Enable cmdk’s local filtering.

Build with these too