Command menu

Search and jump across dense destinations or actions from a modal command surface — a role="combobox" search field owning a role="listbox" result list over the overlay recipe. The primary search gets a generous integrated header, while results and group labels use the same dense application-choice recipe as Menu, Select, and SidebarNav; filtering, focus trapping, and command execution remain host/L2 behavior.

Command menu · Live

The real thing over the live section list — ⌘K / Ctrl+K opens it from anywhere; arrows move the active row, Enter jumps, Escape returns focus to the trigger.

Anatomy

A modal's anatomy only exists over the scrim, so there is no static twin — open the live demo and inspect the real thing.

PartRolesNotes
Shellsurface.panelradius.containersurface.overlayshadow.highThe distinct modal recipe — viewport minus a space.8 gutter, capped just under container.sm wide and eighteen dense-row units tall.
Search rowsize.control.lgfont.size.button-mdspace.3A 48px integrated header with the quieter 14px text and 16px i-search glyph used by the default control recipe — the area has presence without enlarging its contents.
Search actionsi-xEscfont.tracking.normalThe clear action appears before a persistent, unboxed Escape hint at the far edge; it matches the shortcut treatment but keeps normal tracking because it is one named key, while the reserved clear slot prevents querying from shifting it.
Resultsspace.1size.control.smThe same panel inset and row gap as Menu, scroll-capped at fourteen dense rows with matching scroll padding.
Group labelfont.size.label-smfont.weight.regularfont.tracking.wideSidebarNav's section-label register and navigation rhythm: the first label keeps the same comfortable top breathing room, with 12px from label to first result and 20px from the previous result to the next label. Menu remains tighter because it is an anchored action popover.
Itemsize.control.smfont.size.copy-smradius.nestedThe shared 32px application-choice row; highlight is driven by data-highlighted or aria-selected.
Shortcutfont.role.uifont.size.copy-smfont.tracking.widerOptional semantic kbd.ds-command__shortcut, identical to Menu's shortcut treatment.
Kind hintfont.role.uifont.size.captionOptional quiet ds-command__meta for a category or result kind — never a shortcut or second label.
Emptytext.secondaryfont.size.copy-smspace.8The contracted literal No results, no query echo, centered in a space.8 block pad; the query stays in the field.

Usage notes

A command menu is search-first navigation; the search is the interface.

VerdictRule
DoKeep result labels short and scannable — group for context with the shared group-label grammar instead of writing longer descriptions.
DoKeep trailing hints semantic — shortcuts use kbd.ds-command__shortcut; category or kind hints use ds-command__meta. Neither becomes a second label.
DoAlways supply the empty message — a filtered list that can go silent reads as broken.
DoExpose the active row through aria-activedescendant or real item focus, trap focus while open, and return it to the trigger on close — host/L2 behavior under this visual contract.
Don’tReach for a command menu when a handful of always-visible actions would do — that is a Menu wearing the same item recipe.
Don’tRun a destructive command directly — a destructive command opens a confirmation flow.