R

Command

8 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandLoading,
  CommandRoot,
  CommandSeparator,
} from '@robonen/primitives/command';

<CommandEmpty>
  <CommandGroup />
  <CommandInput />
  <CommandItem />
  <CommandList />
  <CommandLoading />
  <CommandRoot />
  <CommandSeparator />
</CommandEmpty>

API Reference

CommandEmpty

Empty
PropTypeDescription
always?booleanRender even while there is no active search term.

CommandGroup

Group
PropTypeDescription
heading?stringGroup heading text (rendered when the default slot doesn't override it).
value?stringStable identifier for the group. Auto-generated when omitted.
forceMount?booleanRender the group even when all of its items are filtered out.

CommandInput

Input
PropTypeDescription
modelValue?stringControlled value; falls back to root `searchTerm`.
disabled?booleanDisable the input.
autoFocus?booleanFocus the input on mount.

CommandItem

Item
PropTypeDescription
valuestringItem value — used by filter, selection, and `data-value`.
keywords?string[]Extra terms the default filter should match against.
disabled?booleanDisable this item — it is skipped by keyboard nav and filtering.
forceMount?booleanRender even when filtered out.

CommandList

List

No props or events — renders its element and forwards attributes.

CommandLoading

Loading
PropTypeDescription
label?stringAccessible label describing the loading state.
progress?numberOptional 0..100 progress value — published via `aria-valuenow`.

CommandRoot

Root
PropTypeDescription
modelValue?stringControlled selected value. Use `v-model`.
defaultValue?stringUncontrolled initial selected value.
searchTerm?stringControlled search term. Use `v-model:searchTerm`.
defaultSearchTerm?stringUncontrolled initial search term.
filter?CommandFilterFunctionCustom scoring filter. Returns 0..1 (0 = hide).
shouldFilter?booleanRun the filter automatically. Set false to perform filtering yourself.
loop?booleanLoop keyboard navigation at the ends of the list.
label?stringAccessible label announced to assistive tech.

CommandSeparator

Separator
PropTypeDescription
alwaysRender?booleanRender the separator even while the search term is active.