StorybookGitHub

Command

Command menu for search and quick actions.

Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile ⌘P
Settings ⌘S

Installation

npx shadcn-vue@latest add https://vuedocs.canceydejean.dev/r/command.json

Usage

Use command for searchable action menus and keyboard-driven palettes. Built on reka-ui's Listbox — unlike the source project, which wraps the React-only cmdk package, this port has no separate command-palette dependency.

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

<template>
  <Command class="max-w-sm rounded-lg border">
    <CommandInput placeholder="Type a command or search..." />
    <CommandList>
      <CommandEmpty>No results found.</CommandEmpty>
      <CommandGroup heading="Suggestions">
        <CommandItem>Calendar</CommandItem>
        <CommandItem>Search Emoji</CommandItem>
        <CommandItem>Calculator</CommandItem>
      </CommandGroup>
      <CommandSeparator />
      <CommandGroup heading="Settings">
        <CommandItem>
          Profile
          <CommandShortcut>⌘P</CommandShortcut>
        </CommandItem>
        <CommandItem>
          Settings
          <CommandShortcut>⌘S</CommandShortcut>
        </CommandItem>
      </CommandGroup>
    </CommandList>
  </Command>
</template>

Wrap with CommandDialog (composes Dialog) for a modal command palette — installing command also installs dialog.