Components

Field

A composable form-field primitive that pairs any control with a label, helper text, and validation messaging — with vertical, horizontal, and responsive layouts.

Basic usage

Wrap a control in Field and pair a FieldLabel with the input via matching htmlFor / id.

We'll never share your email with anyone.

Field groups

Use FieldGroup to stack several fields with consistent spacing.

Optional — appears on your invoices.

Validation

Add data-invalid to the field and render a FieldError to surface a destructive-colored message with role="alert".

Fieldsets & legends

Group related fields under a semantic FieldSet with a FieldLegend. Set orientation="horizontal" on a field to align its label and control in a row.

Billing address

Where should we send your receipts?

Props

PropTypeDefaultDescription
orientation'vertical' | 'horizontal' | 'responsive''vertical'Stacks the label and control (vertical), aligns them in a row (horizontal), or switches from stacked to row at the @md container breakpoint (responsive). Applies to Field.
data-invalidbooleanWhen present on Field, switches the label, description, and error text to the destructive color.
variant'legend' | 'label''legend'Sizing of FieldLegend — full base size for section titles, or compact label size when nested.
errorsArray<{ message?: string }>Convenience prop on FieldError — renders a single message inline, or a bulleted list when multiple errors are passed. Ignored when children are provided.
classNamestringAdditional Tailwind classes merged onto the underlying element.
...restHTMLAttributesNative props are forwarded to the underlying element for each part.

Accessibility

  • FieldLabel renders a native <label> — match its htmlFor to the control's id so clicking the label focuses the input and screen readers announce the name.
  • Field applies role="group", semantically associating the label, control, and helper text as a single unit.
  • FieldError carries role="alert" so validation messages are announced when they appear; set aria-invalid on the control to mark it invalid.
  • FieldSet renders a native <fieldset> and FieldLegend a <legend>, giving grouped controls (radios, checkboxes) an accessible group label.