The live demo starts when it’s in view.Click in the app, then Ctrl K (⌘K) or / · type, arrows, Enter · Backspace goes back, Esc closes
Ctrl K, ⌘K or / opens a palette of commands, pages and anything else.
What it costs a frame
CPU
<0.01 ms
02468101216.7 ms
GPU
not used
CPU, median
<0.01 ms
CPU, 95th pct
1.13 ms
Draw calls
0
Weight
Light
Measured 7 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured with the palette open, typing a new query every eight frames (fourteen in turn, from one letter to a missing word), with the people search answering at once: each step ranks every group, redraws the list and moves the highlight. Closed, it costs nothing. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
not timed
<0.01
2.54
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
not timed
<0.01
1.60
Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.
What it needs
Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
What it’s for
Jump to any page or record
Run any command without a menu
Settings and theme switching
Searching people or documents on a server
Power users and keyboard-only use
Pitfalls, in brief
A whole name typed runs that name.
Import command-palette.base.css before command-palette.css (or your own look).
Ctrl K and / may already be taken: the browser’s own Ctrl K (the address bar’s search in Chrome and Firefox) gives way to preventDefault, but bind only once, on window, and do not bind a bare / while the user is typing in a field (bindPaletteKeys skips it).
Home and End move the highlight, not the caret (Shift+Home still selects the typed text).
Focus stays in the input the whole time; the list is never focused.
4 more in brief
Recent remembers ids.
A search source must return quickly to the palette even when it cannot cancel: the palette drops replies for an older query, but an expensive search still costs the server.
Shortcuts shown beside commands are labels: the palette does not bind them.
Contained in an element (the container option), the backdrop covers that element only: give it position: relative and let it be at least as tall as the palette.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.
Where it comes from
Written for the library. Fully custom code.
WAI-ARIA Authoring Practices Guide (W3C): the combobox pattern (a text input owning a listbox, the highlight given by aria-activedescendant) and the listbox pattern’s groups
A small appearance system: colour presets as CSS variables (light, dark, two high-contrast, two accent looks), a “Match system” choice that follows the…