Input with icon and kbd
canonInput with a leading icon or a trailing keyboard hint, used for search.
Used in 6 files · 4 areas · 17× — components/AppShell, components/GlobalSearch, components/callwrapup, components/search
.acrm-inputwrap .acrm-inputwrap--num .acrm-inputwrap--code .acrm-inputwrap--short +2SourceStoryLegacy card Inputs.htmlKeyboard
- The inner
<input>is the only tab stop; icon and kbd chip are not focusable. - The chip announces a shortcut that the screen must implement (
⌘K//focus the field, Esc clears or blurs); the DS ships the visual only. .is-disabledon the wrapper is visual — adddisabledto the input to remove it from the tab order.
ARIA
- The wrapper is a plain
<span>; no role. Name the input witharia-label("Search") — the placeholder alone is not a reliable name. - The icon is decorative (
aria-hiddenfrom<Icon>); the kbd chip is plain text and is read as "command K" — acceptable, or hide it witharia-hiddenand put the shortcut inaria-keyshortcutson the input. - For a search field use
type="search"orrole="searchbox"so it is listed as such. - Error:
aria-invalidon the input with.is-erroron the wrapper.
Focus
.acrm-inputwrap:focus-withindraws the ring on the wrapper (accent border +0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent)); the inner input hasoutline: 0so there is one ring, on the box.- Applies to pointer focus as well (
:focus-within, not:focus-visible).
Contrast
Computed from packages/ui/src/tokens/tokens.css:
- Input text
--fgon--surface-100= 17.59:1 (light); on--surface-50= 13.09:1 (dark). - Icon and kbd text
--fg-secondary#7d8184 on white = 3.93:1 (light); #9a9ca1 on #232529 = 5.59:1 (dark). Kbd is 11px text — below AA 4.5:1 in light. - Kbd border
--border-strong= 1.38:1 (light), 1.55:1 (dark). - Placeholder
--fg-muted= 2.85:1 (light), 3.27:1 (dark). - Focus border
--accent= 4.44:1 (light), 3.83:1 (dark); error border--critical= 3.91:1 / 4.35:1.
Known limits
- The shortcut in
.acrm-kbdis not bound by the DS; an unbound chip is a false promise. - Kbd text (11px, 3.93:1) and the placeholder are below AA in light theme.
- No slot for a clear button; the field cannot be emptied by pointer without a separate control.
.is-disableddoes not disable the input by itself.
Source: docs/text-field/input-with-icon-kbd.a11y.md · GitLab