Text Area

How the Text Area works with a keyboard and assistive tech, and where it stands against WCAG 2.2 AA.

AAWCAG 2.2 target
9/20contrast pairs passing
3keyboard interactions

The Text Area is a native <textarea> with the Input's label, hint and states. The browser supplies typing, selection and line breaks. The component adds a native length limit, a counter announced politely, and the resize glyph from the platform.

Keyboard#

Tab

Moves focus into the field. Tab does not indent; it always moves on.

Shift+Tab

Moves focus to the previous focusable element.

Enter

Adds a new line. It does not submit the form.

Semantics#

<textarea>

Native role, multi-line, announced as an edit text with its label.

Always
<label for>

Gives the field its name, and a click on the label focuses it.

Always
maxlength

200 by default. Typing stops at the limit rather than failing later.

Always
aria-live="polite"

The count is announced after a pause in typing. It is not linked to the field, so it is not read on focus.

Counter
aria-invalid="true"

Announced as invalid. The hint says what to fix.

error
aria-describedby

Links the hint or error, so it is read after the name.

Always
readonly / disabled

Read Only stays focusable and its text can be selected; Disabled leaves the tab order.

Read Only, Disabled

Colour contrast#

Every variant and state has to meet WCAG 2.2 Level AA. Measure the colours as they land on screen: a translucent hover or press wash over whatever sits behind it.

4.5:1

Text and label · Default, Hover, Focused, Read Only

The text and label in #2a2a2a pass on white, the 4% wash and the #f2f2f2 read-only fill.

WCAG 1.4.3 Contrast (Minimum) ↗
4.5:1

Placeholder and counter · Empty, Always

Both are #8f8f8f, 3.23:1 on white. The counter is 10px uppercase, so the small size makes it harder still. Both fail.

WCAG 1.4.3 Contrast (Minimum) ↗
3:1

Field boundary · Default, Hover

The 1px #e1e1e1 stroke, 1.31:1 on white. The focused (#070707) and error (#ec0d33) strokes pass.

WCAG 1.4.11 Non-text Contrast ↗
Not colour alone

Error · Error

The red stroke is backed by the hint's words and aria-invalid.

WCAG 1.4.1 Use of Color ↗WCAG 3.3.1 Error Identification ↗
3:1

Focus indicator · Focus visible

A 2px ring in #1a6ef8 off a white gap, on keyboard focus only. It measures 4.54:1 on white, so it clears 3:1 on every light surface the library uses.

WCAG 1.4.11 Non-text Contrast ↗WCAG 2.4.13 Focus Appearance ↗
Not required

Disabled · Disabled

Inactive controls are exempt. The disabled text and glyphs (#cbcbcb) are deliberately faint.

WCAG 1.4.3 Contrast (Minimum) ↗

Measured contrast#

Each part against the field's white fill, or the 4% hover wash over it, from the ds.css tokens; text, the counter included, is held to 4.5:1 and the stroke, a graphic, to 3:1. 11 of 20 pairs fall below their minimum (4.5:1 for text, 3:1 for graphics) and are marked in amber.

Part · elementDefaultHoverFocusedError
Field · text14.35passes13.17passes14.35passes14.35passes
Field · placeholder3.23below the minimum2.97below the minimum3.23below the minimum3.23below the minimum
Field · stroke1.31below the minimum1.20below the minimum20.14passes4.49passes
Field · counter3.23below the minimum2.97below the minimum3.23below the minimum3.23below the minimum
Hint · text5.17passes5.17passes5.17passes4.49below the minimum

Motion#

  • The fill and stroke change over 150ms, and are turned off under prefers-reduced-motion.
  • Resizing follows the pointer; nothing animates on its own.

Checklist#

Every text area has a visible label, and the limit is said before it is reached: in the hint, or by the counter.

The counter (#8f8f8f at 10px, 3.23:1) and the placeholder are under 4.5:1 and need a darker shade before the code library ships.

Announcing every keystroke's count is noisy. Consider announcing only near the limit (say, 20 left) and at it.

The resting stroke (#e1e1e1, 1.31:1) is under the 3:1 non-text minimum, as on the Input.

Resize is vertical only, so the field never pushes the layout sideways. The resize glyph is the browser's own handle; keyboard users get the full height by scrolling inside.