Form field

The composition component: label, control, and help or error copy, plus the wiring that binds them. Standalone fields keep their intrinsic rhythm; the aligned-row companion gives a pair of sibling fields shared natural-height label, control, and message tracks, then returns them to an ordinary stack below breakpoint.md.

Form field · Stacked
As it appears on the invoice.

The default is label and control alone, bound via for, on one space.2 gap. The caption line is opt-in: help when there is real context to add — never a repeat of the label, never load-bearing placeholder text — and the error takes its place while invalid.

Form field · Aligned rows
Only customers on these terms enter this sequence.
Replies from customers land here,
not in a no-reply inbox.
The window has to start and end on the same day.
Use 09:00–17:00 in the customer’s local time.

Each ds-field-row aligns one pair through shared label, control, and natural message tracks. Missing copy leaves the message track empty; wrapping help or error expands it for both siblings, and the error icon stays on the first line. Below breakpoint.md, each pair stacks in source order.

Form field · Error
Enter a valid email address.

Errors wire as a triple — aria-invalid on the control, an id on the message, aria-describedby pointing at it — and the whole block answers: the label joins the control's red via :has(), no extra wiring. The error replaces the help line and states the fix; type into the field to watch it clear.

Form field · Row
Accept the terms to continue.

Binary controls swap the label + control pair for a clickable row — the rows themselves are demoed with their components (see Checkbox and Radio). FormField adds the caption composition: a row needing help or error sits inside ds-field, wired with the same triple.

Usage notes

The field composes; the control keeps its own contract.

VerdictRule
DoGive every control a visible label via ds-field__label with foraria-label substitutes only when the surrounding context is the label.
DoWire errors as the triple — aria-invalid on the control, an id on the message, aria-describedby pointing at it; the color change alone is never the signal.
DoState the fix in the error (Enter a valid email address), not the failure — and let it replace the help line: one caption at a time.
DoLabel a radio or checkbox group with fieldset + legendds-field__label labels one control, a legend labels the group.
DoMark the optional fields ((optional)) when most are required, instead of starring every required one.
DoWrap each pair in ds-field-row when a multi-column form needs labels, controls, and variable-length messages to align.
Don’tRepeat the label as help, or promote load-bearing placeholder text to a caption — help is optional context below the control.
Don’tStack a ds-field__label above a lone checkbox — binary controls take the row, the label wrapping the control and its text.
Don’tLet the error icon carry the meaning — it is decorative (aria-hidden); the text is the message.
Don’tPlace independent ds-field boxes directly in a page grid or reserve a fixed caption height — both drift as help and errors wrap.