Toggle Sidebar B
AppearanceLight & dark mode D

Command

Command palette pattern. Composable input + grouped item list with fuzzy search. CommandDialog wraps it in a modal for global ⌘K menus.

Default

Inline command palette anchored to its container.

Replay preview
No results found.
Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile⌘P
Billing⌘B
Settings⌘S

Basic

A simple command menu in a dialog.

Replay preview

Shortcuts

CommandShortcut right-aligns a keyboard hint inside each item.

Replay preview

Groups

A command menu with groups, icons and separators.

Replay preview

Scrollable

A long list scrolls inside CommandList while the input stays pinned.

Replay preview

Anatomy

Import all parts and piece them together.

vue
<script setup>
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
} from "@/components/ui/command";
</script>

<template>
  <Command>
    <CommandInput />
    <CommandList>
      <CommandEmpty />
      <CommandGroup>
        <CommandItem />
        <CommandItem />
      </CommandGroup>
      <CommandSeparator />
      <CommandGroup>
        <CommandItem />
        <CommandItem />
      </CommandGroup>
    </CommandList>
  </Command>
</template>

API Reference

Command

PropTypeDefaultDescription
modelValuestringSelected item value. Supports v-model.
filter(value, search) => numberfuzzyCustom match scorer.
EventDescription
update:modelValueFires when the highlighted/selected value changes.

CommandDialog

PropTypeDefaultDescription
openbooleanDialog open state. Supports v-model:open. Wrap the contents in a Command.
titlestring"Command Palette"Accessible dialog title (visually hidden).
descriptionstring"Search for a command to run..."Accessible dialog description (visually hidden).
showCloseButtonbooleanfalseShow the dialog close (×) button.
EventDescription
update:openFires when the dialog opens or closes.

CommandInput

PropTypeDefaultDescription
modelValuestringSearch query. Supports v-model.
placeholderstringPlaceholder text for the search field.

CommandItem

PropTypeDefaultDescription
valuestringValue used for filtering and selection.
disabledbooleanfalseBlock selection of this item.
EventDescription
selectFires when the item is chosen via click or Enter.

CommandGroup / CommandEmpty

PropTypeDefaultDescription
headingstring(CommandGroup) Section heading. CommandEmpty renders when no item matches.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
ATyping in the input filters the item list.
Moves the highlight to the previous item.
Moves the highlight to the next item.
EnterSelects the highlighted item.
EscCloses the palette when shown in a dialog.
  • Follows the combobox/listbox pattern: a textbox input controls a role=listbox of items.
  • aria-activedescendant tracks the highlighted item while DOM focus stays on the input.