Installation
This component is primitive-agnostic — same source under both flavors.
Basic
We only use it to send your ticket.
Field connects the description and error to the control through aria-describedby, so a screen reader reads them on focus. The label stays visible and associated with the input, even when the placeholder changes.
Validation
- Use at least 8 characters.
- Include a number.
Set data-invalid on the Field for the label and aria-invalid on the control for the field itself. FieldError accepts a plain message, a list of messages from a form library or Standard Schema validator, or both — children win.
Textarea
Optional. The team reads every note.
Group and fieldset
Horizontal
Used by the CLI and integrations.
orientation="responsive" keeps the stacked layout until the surrounding FieldGroup is wide enough, then switches to a row without a viewport breakpoint.
API Reference — Field
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" | "horizontal" | "responsive" | "vertical" | Stack the label above the control, put them side by side, or switch to side by side once the surrounding FieldGroup is wide enough. |
| data-invalid | boolean | — | Turns the field's label red. The control still carries its own aria-invalid. |
| aria-label / aria-labelledby | string | — | Names the field as a group. Only applied when one is supplied, so a single label/control field is not announced as an unnamed group. |
| className | string | — | Styles the field block. |
Parts
| Prop | Type | Default | Description |
|---|---|---|---|
| FieldGroup | div | — | Stacks fields 12px apart and establishes the @container/field-group scope. |
| FieldSet | fieldset | — | Semantic group of fields; stacks them 12px apart without a browser border. |
| FieldLegend | variant="legend" | "label" | — | Titles a fieldset. label matches FieldLabel for a nested fieldset. |
| FieldContent | div | — | The label/description column beside a control in horizontal layouts. |
| FieldLabel | label | — | Associates text with its control via htmlFor. Wrapping a whole Field turns it into a bordered choice card. |
| FieldTitle | div | — | A title styled like a label but tied to no control. |
| FieldDescription | p | — | Helper text. Field links its id into the control's aria-describedby. |
| FieldSeparator | div | — | A rule with optional centered text; pass the surface background on cards. |
| FieldError | div | — | Error text or a list from errors. Children win when both are supplied; duplicates collapse. |