Skip to main content

Text

A label, the field and a line of help. Set the height with rows (3 by default) and the first text with value. The label is linked with for and id, the help text with aria-describedby.

Let us know how we can help.

Hint

A question-mark button next to the label opens a short hint. It works like the one on the input: the same aria-expanded popup, and the hint is linked with aria-describedby.

Optional.

Sizes

Three sizes: small, medium and large. Medium is the default and uses the same padding and text size as the input.

Resize

Textareas are fixed by default, so the layout does not move. Add resize to let the person drag the corner to change the height. Horizontal resizing is left out because it breaks most layouts.

Character limit

Use maxlength and the browser stops typing at the limit. Say the limit in the help text.

Up to 200 characters.

States

A disabled field is skipped by the keyboard. A read-only field can be focused and copied. Mark required fields with required; the asterisk is hidden from assistive tech because the attribute already says it.

Validation

Add required, minlength or maxlength and the browser checks the value when the form is sent. error shows a message at once and sets aria-invalid="true", for an error the server returns.

Write at least 20 characters.

Promotional text is not allowed.