Field
Combine labels, controls, and help text into accessible form fields and grouped inputs. Supports vertical, horizontal, and responsive orientations plus validation via `FieldError`.
Basic
Label, control, and optional FieldDescription in a vertical stack.
Installation
CLI
Also needs
npx @sonojs/ui@latest add label separatorComposition
structure
Usage
field.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" · "horizontal" · "responsive" | "vertical" | On Field — layout of label vs control. responsive uses @container/field-group. |
| variant | "legend" · "label" | "legend" | On FieldLegend — label sizes the legend like a FieldLabel. |
| data-invalid | boolean | — | On Field — turns label/description/error into the destructive state. |
| errors | Array<{ message?: string }> | — | On FieldError — renders one message or a list from form validators. |