Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Chat Input
  3. Accessibility

Chat Input

Accessibility

Import ChatInput, ChatInputLayout, hasSendableText from @prepared911/ui/chat-input.
Name
The typed area is a textbox with aria-multiline. ChatInput renders no label; the screen names it with aria-label or aria-labelledby. The placeholder is exposed as aria-placeholder, a hint and not a name. The add, Send and Stop controls are icon-only Buttons named by addLabel, sendLabel and stopLabel, each also shown as a tooltip. The context chips and the suggestions are lists named by chipsLabel and suggestionsLabel.
Keys
  • Enter sends and Shift+Enter inserts a newline. This is the opposite of a text area, so a product that wants it spoken says so in its own help text; the key meaning is not hidden in a role or shortcut attribute.
  • Enter during an input method composition confirms the candidate and never sends, and a press on Send during one is ignored, so people typing Japanese, Chinese or Korean are not interrupted.
  • enterKeyHint="send" labels the Enter key on mobile keyboards.
  • Focus stays in the typed area after a send. Nothing in ChatInput blurs it, and Send never takes focus from a pointer press. A keyboard activation of Send hands focus back to the typed area.
  • Choosing a row of the attach menu returns focus to the typed area, so typing carries on. Only that one return is redirected: a later keyboard focus on the add control stays on it. Closing the menu without a choice leaves focus on the add control.
  • Choosing a suggestion puts the caret in the text after the new chip.
Chips
An inline chip is one atomic character to the caret. The arrow keys step over it in one press in the direction they point (reversed under right-to-left), Shift+Arrow selects it, and Backspace or Delete removes it whole; the keys do not leave this to the browser, because engines differ on an uneditable inline host. The remove control of each chip is a named button that is in the tab order after the typed area. Pressing it, or Enter, Space, Backspace or Delete on it, removes the chip and moves focus back to the typed area with the caret where the chip was, so focus is never dropped to the page. Every removal by a key or the control announces the chip's removedAnnouncement politely; a removal by cut or select-all announces nothing, since the person made that edit on purpose. Context chips are in a named list above the text.
Empty and pending
A disabled Send cannot be focused, so sendDisabledAnnouncement is announced politely when the person empties the text and when they press Enter in an empty composer. While a response generates and there is no Stop, Send shows a spinner, sets aria-busy, stays focusable, and announces its pending name. It is not disabled.
State
  • Disabled takes the typed area out of the tab order, sets aria-disabled, and disables every control (ADR 0015), including Stop and Send while a response generates: a disabled composer shows Send disabled, not pending.
  • Read-only stays focusable (tabindex="0", aria-readonly) and never sends. While a response generates, Stop stays usable (stopping is not editing the text) and a pending Send stays focusable and ignores presses.
  • Invalid is aria-invalid; the surface edge changes weight and, under forced colors, color. The stacked layout has no border, so it draws the same strong edge on the rule under the typed row. The error text belongs to Field or the screen, wired with aria-describedby.
Size and growth
The typed area grows with its text instead of scrolling a single line, so what is typed is visible. It stops at six lines and scrolls; the scroll region is the typed area itself and takes keyboard scrolling natively. Text reflows at 320 CSS px with no sideways scrolling: long strings wrap anywhere.
Contrast and forced colors
Text, placeholder and edge colors are tokens and clear WCAG 2.2 AA in light and dark (checked with axe: typed, placeholder, invalid and read-only). Under forced-colors: active the surface border stays, the focused surface takes Highlight, and the invalid state adds a strong Mark border.
Motion
ChatInput adds none. The controls keep their own: Send swaps its arrow and spinner at once under reduced motion, and the menu and tooltips follow the preference. The height follows the text with no transition.
Previous
Chat Input / API and Development
Next
Chat Scroll / Usage
On this page
Name
Keys
Chips
Empty and pending
State
Size and growth
Contrast and forced colors
Motion