Command
A command palette for searching and executing actions quickly.
Interactive
Requires:
veritheme.js
JS init: automatic
Default
A command palette with a search row, titled groups, item icons and shortcuts, and a footer hint. Try typing to filter; arrows and Enter pick an item.
html
Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile
⌘P
Billing
⌘B
Settings
⌘S
No results found.
<div class="vt-command-wrapper vt-max-w-md vt-w-full">
<div class="vt-command-search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-search-icon" aria-hidden="true">
<path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<input type="text" placeholder="Type a command or search..." aria-label="Type a command or search..." class="vt-command-input" oninput="veritheme.filterCommand(this)" onkeydown="veritheme.navigateCommand(event, this)">
</div>
<div class="vt-command-list">
<div class="vt-command-group" data-vt-command-group="">
<div class="vt-command-group-heading">Suggestions</div>
<div class="vt-command-item vt-selected" data-vt-value="calendar">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<path d="M16 2V6M8 2V6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 10H21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M10 18.5002L9.99999 13.8474C9.99999 13.6557 9.86325 13.5002 9.69458 13.5002H9M14 18.4983L15.4855 13.8923C15.4951 13.8626 15.5 13.8315 15.5 13.8002C15.5 13.6346 15.3657 13.5002 15.2 13.5002L13 13.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
Calendar
</div>
<div class="vt-command-item" data-vt-value="emoji">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M8 15C8.91212 16.2144 10.3643 17 12 17C13.6357 17 15.0879 16.2144 16 15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M15.625 8.387V8.91649M8.375 8.387V8.91649M8.75 8.75C8.75 8.33579 8.58211 8 8.375 8C8.16789 8 8 8.33579 8 8.75C8 9.16421 8.16789 9.5 8.375 9.5C8.58211 9.5 8.75 9.16421 8.75 8.75ZM16 8.75C16 8.33579 15.8321 8 15.625 8C15.4179 8 15.25 8.33579 15.25 8.75C15.25 9.16421 15.4179 9.5 15.625 9.5C15.8321 9.5 16 9.16421 16 8.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
Search Emoji
</div>
<div class="vt-command-item" data-vt-value="calculator">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<path d="M5.5 3V8M8 5.5L3 5.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 16L6 18M6 18L4 20M6 18L8 20M6 18L4 16" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M20 6L16 6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M20 18.5L16 18.5M20 15.5L16 15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M22 12L2 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 22L12 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
Calculator
</div>
</div>
<div class="vt-command-separator" role="separator"></div>
<div class="vt-command-group" data-vt-command-group="">
<div class="vt-command-group-heading">Settings</div>
<div class="vt-command-item" data-vt-value="profile">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<path d="M20 21.0001C19.713 17.269 16.7289 14.3151 12.995 14.0662L12 13.9999C11.6446 14.0096 11.3134 14.0225 11.0008 14.0378C7.3 14.2192 4.28417 17.3057 4 21.0001" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><circle cx="12" cy="6.99988" r="4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
</svg>
Profile
<kbd class="vt-command-shortcut">⌘P</kbd>
</div>
<div class="vt-command-item" data-vt-value="billing">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<path d="M10 4H14C17.7712 4 19.6569 4 20.8284 5.17157C22 6.34315 22 8.22876 22 12C22 15.7712 22 17.6569 20.8284 18.8284C19.6569 20 17.7712 20 14 20H10C6.22876 20 4.34315 20 3.17157 18.8284C2 17.6569 2 15.7712 2 12C2 8.22876 2 6.34315 3.17157 5.17157C4.34315 4 6.22876 4 10 4Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M2.5 9H21.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14 15L18 15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
Billing
<kbd class="vt-command-shortcut">⌘B</kbd>
</div>
<div class="vt-command-item" data-vt-value="settings">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-item-icon" aria-hidden="true">
<path d="M3.95631 10.5829L3.03254 9.07084C2.74505 8.60024 2.7389 8.00978 3.01652 7.5333L3.63533 6.47124C3.90953 6.00064 4.41721 5.71571 4.96162 5.7269L6.69131 5.76245C6.92616 5.76728 7.15379 5.68727 7.34333 5.54846C7.79531 5.21745 8.28334 4.93276 8.80042 4.70139C9.01191 4.60675 9.19222 4.45165 9.30469 4.24903L10.1203 2.77965C10.3847 2.30328 10.8865 2.00781 11.4312 2.00781H12.6937C13.2384 2.00781 13.7403 2.30329 14.0047 2.77966L14.8202 4.24902C14.9327 4.45165 15.113 4.60675 15.3245 4.70139C15.8416 4.93274 16.3296 5.2174 16.7815 5.54838C16.9711 5.68718 17.1987 5.76718 17.4336 5.76235L19.1634 5.72676C19.7078 5.71557 20.2155 6.00049 20.4897 6.47111L21.1085 7.53314C21.3862 8.00963 21.38 8.60009 21.0925 9.07068L20.1687 10.5828C20.0481 10.7803 20.002 11.0134 20.0235 11.2439C20.0707 11.7486 20.0707 12.267 20.0235 12.7717C20.002 13.0022 20.0481 13.2353 20.1687 13.4329L21.0924 14.9448C21.3799 15.4154 21.3861 16.0058 21.1084 16.4823L20.4896 17.5444C20.2154 18.015 19.7077 18.2999 19.1633 18.2887L17.4338 18.2531C17.1989 18.2483 16.9713 18.3283 16.7817 18.4671C16.3297 18.7982 15.8416 19.0829 15.3245 19.3142C15.113 19.4089 14.9327 19.564 14.8202 19.7666L14.0047 21.236C13.7403 21.7123 13.2384 22.0078 12.6937 22.0078H11.4312C10.8866 22.0078 10.3847 21.7123 10.1203 21.236L9.30468 19.7665C9.19222 19.5639 9.01191 19.4088 8.80042 19.3142C8.28329 19.0828 7.79519 18.798 7.34316 18.467C7.15362 18.3282 6.92597 18.2482 6.69111 18.253L4.96175 18.2886C4.41733 18.2998 3.90963 18.0148 3.63543 17.5442L3.01663 16.4822C2.739 16.0057 2.74515 15.4152 3.03264 14.9446L3.95631 13.4327C4.07699 13.2351 4.12309 13.002 4.10154 12.7715C4.05437 12.267 4.05438 11.7486 4.10154 11.244C4.12308 11.0135 4.07699 10.7805 3.95631 10.5829Z" stroke="currentColor" stroke-width="1.5"></path><circle cx="12.0625" cy="12.0078" r="3.5" stroke="currentColor" stroke-width="1.5"></circle>
</svg>
Settings
<kbd class="vt-command-shortcut">⌘S</kbd>
</div>
</div>
</div>
<div class="vt-command-empty vt-hidden">No results found.</div>
<div class="vt-command-footer">
<span data-vt-command-status="" aria-live="polite">↑↓ to navigate</span>
<span>↵ to select</span>
</div>
</div>
Empty State
What users see when their search query returns no results.
html
No results found.
<div class="vt-command-wrapper vt-max-w-md vt-w-full">
<div class="vt-command-search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-command-search-icon" aria-hidden="true">
<path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
</svg>
<input type="text" class="vt-command-input" value="something random..." aria-label="Search commands" readonly="">
</div>
<div class="vt-command-empty">No results found.</div>
</div>
Guidelines
Calendar
Settings
⌘S
United States
Canada
Anatomy
div.vt-command-wrapper ← Root wrapper
├── div.vt-command-search ← Search row
│ ├── svg.vt-command-search-icon ← Search icon
│ └── input.vt-command-input ← Filterable text input
├── div.vt-command-list ← Scrollable results
│ ├── div.vt-command-group ← Named group
│ │ ├── div.vt-command-group-heading ← Group title
│ │ └── div.vt-command-item ← Selectable item
│ │ ├── svg.vt-command-item-icon ← Item icon
│ │ └── kbd.vt-command-shortcut ← Shortcut
│ └── div.vt-command-separator ← Line between groups
├── div.vt-command-empty ← No results state
└── div.vt-command-footer ← Hint row
API Reference
| Class | Type | Description |
|---|---|---|
vt-command-wrapper |
Base | Outer wrapper for the command palette |
vt-command-search |
Part | Search row: icon and input, with a line under it |
vt-command-search-icon |
Part | Search icon at the start of the row (16px, muted) |
vt-command-input |
Part | Search input field inside the search row |
vt-command-list |
Part | Scrollable list container for groups and items |
vt-command-group |
Part | Group wrapper for related command items |
vt-menu-label |
Part | Title of a group (MenuLabel, the same as in Dropdown Menu); role="presentation" |
vt-command-group-heading |
Part | Older name of the group title: looks the same as vt-menu-label and still works |
vt-command-item |
Part | Individual selectable command item |
vt-command-item-icon |
Part | Leading icon of an item (16px, muted) |
vt-command-shortcut |
Part | Keyboard shortcut pushed to the end of an item |
vt-command-separator |
Part | Separator line between groups |
vt-command-empty |
Part | Empty state shown when no results match |
vt-command-footer |
Part | Hint row under the list, with a line above it |
vt-selected |
State | Highlights the item Enter will run (vt-active works too) |
vt-hidden |
State | Hides filtered-out items or empty state |
Accessibility
| Feature | Details |
|---|---|
| Role | Use role="combobox" on input with role="listbox" on results list |
| Keyboard | Arrow keys navigate results, Enter selects, Escape closes |
| Search | Input should have aria-autocomplete="list" and aria-controls linking to results |
| Active | Active result has aria-selected="true", announced to screen readers |