Feature Library

Command palette

<0.01 CPU ms
A still of the Command palette demo
Still
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

<0.01 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.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed<0.011.13
apple · Apple A19 Proin a browser tab · 16 November 2026not timed<0.012.54
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed<0.011.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

  1. Jump to any page or record
  2. Run any command without a menu
  3. Settings and theme switching
  4. Searching people or documents on a server
  5. Power users and keyboard-only use

Pitfalls, in brief

  1. A whole name typed runs that name.
  2. Import command-palette.base.css before command-palette.css (or your own look).
  3. 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).
  4. Home and End move the highlight, not the caret (Shift+Home still selects the typed text).
  5. Focus stays in the input the whole time; the list is never focused.
4 more in brief
  1. Recent remembers ids.
  2. 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.
  3. Shortcuts shown beside commands are labels: the palette does not bind them.
  4. 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

command palettecomboboxlistboxsearchfuzzy matchingkeyboardaccessibilityaria-activedescendantasyncdomno dependencies

Near it in the frame