Menu
Command
A search box over a list of commands that filters as you type, inline or as a modal palette opened with a hotkey.
WAI-ARIA tested
Import
main.ts
import { Command } from '@vitral/vue';Inline
Calendar
Search emoji
Calculator
Profile⌘P
Notifications⌘B
Preferences⌘S
Palette
…or press Ctrl+J (⌘J).
API
Read from packages/vue/src/components/Command/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| shouldFilter | boolean | Hide the items the search does not match. Off, the app filters (and renders only what matches). Defaults to true. |
| filter | (value: string, search: string, keywords: string[]) => number | boolean | Scores an item against the search: 0 (or false) hides it, and higher scores come first. Defaults to core's `commandScore` (whole text, then prefix, word start, anywhere, and letters in order) over the value and keywords, ignoring case and accents. |
| loop | boolean | Wrap from the last item to the first with the arrows. |
| label | string | Names the list. Defaults to the locale's "Command palette". |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| select | value: string | An item was chosen, by Enter or a press. |
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |