Type to filter, arrows move, Tab jumps sections, Enter runs. The demo drives the menu on a loop.
A command menu for steering the agent: a search field over grouped commands with app marks and shortcut chips. Typing filters the list and offers an ask-the-agent row; Enter runs a command and the footer confirms.
Type to filter – matches highlight and an "Ask the agent about …" row leads the results. Arrows move the lit row with wrap-around, Tab and Shift+Tab jump between sections, Home and End go to the edges, and the list keeps the pick in view. Enter or a click runs the command: the row pops, the footer swaps to a done line for a beat and the list height breathes to fit. Esc clears the query. The demo loops typing, section jumps and runs; Replay restarts it.
Options for the assembled component.
groups*CommandGroup[]Labeled sections of commands: id, name, optional hint, keys, keywords, logo or icon and done text.
query / onQueryChangestring / (q) => voidControlled search text. Uncontrolled, typing filters in place.
active / onActiveChangestring / (key) => voidControlled selected option key. Uncontrolled, the first option stays lit and arrows or hover move it.
onRun(item) => voidCalled on Enter or click. Without ran/done the menu flashes the row and shows item.done in the footer.
ran / donestring / stringControlled pop-animation key and footer line. The demo drives both.
askIconReactNodeMark on the injected "Ask the agent about …" row.
labels / placeholderPartial<MenuLabels> / stringOverrides for every string the menu renders.
classNamestringExtra class on the root.
_command-menu/command-menu.tsxSearch label, listbox with the sliding selection pill, grouped option rows with marks, hints and kbd chips, and the footer with tips and the done line.
_command-menu/menu-model.tsFiltering, the injected ask row, flat option order, arrow/Tab/Home/End key targets and the mark segment splitter.
_command-menu/types.tsCommandItem, CommandGroup and MenuLabels with the default strings.
_command-menu/use-command-menu-script.tsPlays the demo loop: arrows, a typed query, a run, section jumps, another run, then reset. Also powers Replay.
_command-menu/command-menu.cssAll colors and spacing as tokens on .cm, with a dark theme, a <480px container collapse, touch and reduced-motion handling.
Recreated from the behavior of a reference command menu. Colors and spacing are the reference values.
Type to filter, arrows move, Tab jumps sections, Enter runs. The demo drives the menu on a loop.