Calm motion: animations on this site only fade, with no movement
Command
⌘K palette
A search-and-run palette for apps with many commands: ⌘K to open, type, Enter. It helps people who know what they want. It does not replace visible navigation.
Use it for actions and navigation, not for picking values (that's Combobox). Items carry a group, optional keywords and a shortcut label.
Basic
or press ⌘K
Inline
New project⌘N
Open recent…⌘O
Save all⌥⌘S
Toggle theme
Zoom in⌘+
Go to character…
Go to news
Recent and scoped
Type @ People, # Tag
Home
Billing
SettingsG S
Ayu Lestari
Budi Santoso
bug
idea
Chose: nothing yet
- ⌘K / Ctrl+K opens it (
hotkey), except inside rich-text editors, where that key already inserts a link. - The input is a combobox over the result list: ↑ / ↓ move, Enter runs, Home / End jump. Groups (
group) are labeled. "No results" is announced. - Recent (
recent): while the search is empty the items chosen before come first, newest first, in a "Recent" group (recentLimit, default 5). Items that are gone or disabled are left out.v-model:historyis the list of values if you want to keep it.persist="app"saves it inlocalStorageunder that key, read after mount. - Scopes (
:scopes="[{ key: '@', group: 'People' }]"): the key of a scope, typed first, narrows the search to thatgroup. A chip shows the scope ("People ×"). Backspace on an empty search or a click on the chip leaves the scope. A hint under the box lists the keys. A key typed anywhere else is plain text. The name of the input gains "Only in People", so it is spoken. labelstranslates "Recent", the chip and the hint.keywordsadd search terms.filterreplaces matching.inlinerenders it in the page instead of a modal.
Usage
ts
import { BlessCommand } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
items* | BlessCommandItem[] | — | |
placeholder | string | "Type a command…" | |
label | string | "Search commands" | accessible name of the search input |
emptyText | string | "No results." | |
hotkey | boolean | true | bind ⌘K / Ctrl+K to open |
inline | boolean | — | render inline instead of inside a modal |
filter | ((item: BlessCommandItem, query: string) => boolean) | — | |
scopes | BlessCommandScope[] | — | prefixes that narrow the search to one group: `[{ key: "@", group: "People" }]` |
recent | boolean | — | put the items chosen before at the top while the search is empty |
recentLimit | number | 5 | |
persist | string | — | keep the history in localStorage under this key (read after mount) |
labels | Partial<{ recent: string; scope: (label: string) => string; clearScope: string; scopeHint: (parts: string[]) => string; }> | — | |
open | boolean | false | |
history | string[] | [] | values of the items chosen so far, most recent first |
Events
| Name | Payload | Description |
|---|---|---|
update:open | [value: boolean] | |
select | [item: BlessCommandItem] | |
update:history | [value: string[]] |
Slots
| Name | Scope | Description |
|---|---|---|
item | { item: BlessCommandItem; } | |
footer | — |