Tag input
canonInput that turns typed values into removable tags.
Registry repaired 17 Oct 2026 (review F3): mapped existing Ladle stories. 19 Oct 2026 (owner, proto/mail-konverzace-chat-poradi@828a56aa0): clamp toggle moves INTO the bubble as the optional `more` prop (text button .cht-more "Show all" / "Show less", aria-expanded, white underlined on the accent bubble); the meta-row "Full message" action is removed; e-mail conversation order is oldest at top, newest at bottom, view anchored to the end of the thread.
Used in 4 files · 4 areas · 10× — components/assistant, pages/AiZamestnanciPage, pages/ProduktDetailPage, pages/PruvodceFirmyPage
Keyboard
- Tab reaches each
.acrm-tag-xbutton in order, then the text input; Enter or Space on the x removes that tag. - In the input: Enter adds the draft as a tag (the screen must
preventDefaultso the form does not submit); Backspace on an empty draft removes the last tag (screen behaviour, as in the story). - Esc is not handled by the DS; forms may use it to clear the draft.
ARIA
- The container is a plain
<div>; no role. Name the input (aria-labeloraria-labelledbyto the Field label). - Each remove button needs
aria-label="Remove <tag>"; the icon is decorative. - Announce additions and removals with a polite live region ("B2B added", "2 tags") — the DS provides none.
- Optionally expose the tag group as a list (
role="list"on a wrapper,role="listitem"on.acrm-tag) so the count is read.
Focus
- Container ring on
:focus-within(accent border +0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent)), also while a remove button is focused. .acrm-tag-xis a<button>, so the foundation ring applies:outline: 2px solid var(--accent); outline-offset: 1pxon:focus-visible.- The inner input has
outline: 0; the container ring is its only indicator.
Contrast
Computed from packages/ui/src/tokens/tokens.css:
- Tag text
--ink-800#1f2023 on--surface-75#fbfbfb = 15.74:1 (light); #e1e2e4 on #161719 = 13.84:1 (dark). - Remove glyph
--fg-muted#98999c on--surface-75= 2.75:1 (light); #717479 on #161719 = 3.82:1 (dark) — below 3:1 in light at rest; hover--ink-900on--active-surfaceis well above. - Tag border
--border#eeeff1 on--surface-75= 1.11:1 (light) — the tag is separated by fill more than by line. - Input text
--ink-900= 17.59:1 (light), 13.09:1 (dark); placeholder--fg-muted= 2.85:1 / 3.27:1.
Known limits
- The remove glyph is below 3:1 at rest in light theme; its 17px hit area is small.
- No disabled or error style on the container.
- Add/remove feedback and the tag count are not announced unless the screen adds a live region.
- The remove button's size (17px) is under the 24px target recommendation; the row height (24px tag) bounds it.
Source: docs/text-field/tag-input.a11y.md · GitLab