Field
Label + control + hint / error composition. Owns the id and aria-invalid wiring.
Field is the single most common form primitive — it generates a stable id, passes it down via a render-prop, and slots a hint or error below the control with the right typography and color. Use it everywhere a form input has a visible label.
Install
Pull from the workspace packages (already available if you ran pnpm add):
Examples
Email with hint and validation
We never share your address.
Doesn’t look like an email.
Anatomy
labelBound to the control via htmlFor → id.children(id, aria-invalid)Render-prop receives the generated id and the current invalid state. Use both on your control.hintQuiet helper text under the control — disappears when error is present.errorReplaces hint when truthy. Triggers invalid styling.Guidelines
✓
Always spread the render-prop id and aria-invalid on the control.Without them the label is decorative and a11y is broken.
✓
Pass error as a string only when there is something to act on.Truthy non-strings still trigger invalid styling — keep the message specific.
✕
Stack two Fields with the same label on one row.Use one Field with a FormGroup of two controls inside instead.