Installation
tokens.css + command-search.css + button.csshead.html
<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="components/command-search/command-search.css">Basic
Command/search list with live filtering and empty state.
No matches
Code
command-search.html + command-search.css
command-search
<style>
/* agent-ui / command-search — first-class component (promoted from host extracts). */
/* 14 Command search */
.au-command-search,
.au-cmd-search {
background: var(--au-surface);
border: 1px solid var(--au-border-color);
border-radius: var(--au-radius-lg);
display: grid;
overflow: hidden;
}
.au-command-search__field,
.au-cmd-search__field {
border: 0;
border-bottom: 1px solid var(--au-border-color);
border-radius: 0;
font: 400 14px/1.4 var(--au-font-sans);
padding: 12px;
width: 100%;
}
.au-command-search__field:focus-visible,
.au-cmd-search__field:focus-visible {
box-shadow: inset 0 0 0 2px var(--au-focus);
outline: 0;
}
.au-command-search__list,
.au-cmd-search__list {
display: grid;
margin: 0;
max-height: 16rem;
overflow: auto;
padding: 8px;
}
.au-command-search__item,
.au-cmd-search__item {
background: transparent;
border: 0;
border-radius: var(--au-radius-md);
color: var(--au-fg);
cursor: pointer;
font: 400 13px/1.35 var(--au-font-sans);
min-height: 40px;
padding: 8px 12px;
min-width: 0;
text-align: start;
}
.au-command-search__item:hover,
.au-cmd-search__item:hover {
background: var(--au-surface-muted);
}
.au-command-search__item:focus-visible,
.au-cmd-search__item:focus-visible {
background: var(--au-surface-muted);
box-shadow: var(--au-focus-ring);
outline: 2px solid var(--au-focus);
outline-offset: 2px;
}
.au-command-search__empty,
.au-cmd-search__empty {
color: var(--au-fg-subtle);
font: 400 13px/1.4 var(--au-font-sans);
padding: 16px 12px;
text-align: center;
}
.au-command-search__empty[hidden],
.au-command-search__item[hidden],
.au-cmd-search__empty[hidden],
.au-cmd-search__item[hidden] { display: none; }
@media (pointer: coarse) {
.au-command-search__item,
.au-cmd-search__item {
min-height: 44px;
}
}
</style>
<p class="fixture-note">Command/search list with live filtering and empty state.</p><div class="au-command-search" data-au-component="command-search" data-au-state="idle"><input class="au-command-search__field" type="search" placeholder="Search commands…" aria-label="Search commands"><div class="au-command-search__list" role="listbox" aria-label="Commands"><button type="button" class="au-command-search__item" role="option">Forecast weekly demand</button><button type="button" class="au-command-search__item" role="option">Find approved vendors</button><button type="button" class="au-command-search__item" role="option">Compare seasonal SKUs</button><p class="au-command-search__empty" hidden>No matches</p></div></div><div hidden><div class="au-command-search" data-au-component="command-search" data-au-state="running"></div><div class="au-command-search" data-au-component="command-search" data-au-state="waiting"></div><div class="au-command-search" data-au-component="command-search" data-au-state="success"></div><div class="au-command-search" data-au-component="command-search" data-au-state="error"></div><div class="au-command-search" data-au-component="command-search" data-au-state="cancelled"></div></div>Component contract
- Install
- tokens.css · command-search.css · button.css
- States
- Host-owned via data-au-state and documented variants
- Host
- content, state transitions, and execution behind actions
For agents
command-search.contract
# agent-ui / command-search
component: command-search
selector: .au-command-search
data_au_component: command-search
purpose: Command/search list with live filtering and empty state.
install:
- tokens.css
- command-search.css
- button.css when rendering actions
states: Host-owned via data-au-state and documented variants.
css_variables: Uses shared semantic tokens.
events: native form, focus, and click only — no custom events or runtime required
no_javascript: Markup and native controls remain usable without script.
host_owns: The host owns content, state transitions, and execution behind actions.
accessibility: Prefer labelled regions and text status, not color alone.
security: Escape untrusted model and tool text before insertion.
rules:
- Host owns execution, authorization, persistence, validation, and state transitions.
- Components render host-provided state; they never execute tools or imply approval.
- Escape untrusted model output, tool args, and tool output before insertion.
- Use only documented data-au-* attributes and data-au-state values.
- Keep the no-JS path usable. Do not add React, Tailwind, bundlers, or remote assets.
source: components/command-search/command-search.{html,css} + README.md + fixture.html