Skip to main content
Skip to design system navigation

FIELD

Source: design-system/components/Field/Field.tsx. Client component ('use client') so consumers can drive controlled input state.

Props

PropTypeDefaultRequired
PropnameTypestringDefaultnoneRequiredyes
ProplabelTypestringDefaultnoneRequiredyes
ProperrorTypestringDefaultnoneRequiredno
PropmultilineTypebooleanDefaultfalseRequiredno
ProprowsTypenumberDefault4Requiredno, with multiline
PropidTypestringDefaultgenerated with useIdRequiredno

Other input or textarea attributes pass through.

States

Required field

SOURCE

<Field name="email" label="$ email:" type="email" />
  <Field name="msg" label="$ message:" multiline rows={3} />
  <Field name="broken" label="$ broken:" error="Required field" />

Accessibility

The label is always rendered and bound to the control by htmlFor. With error, the control gets aria-invalid="true" and aria-describedby points at the error text, merged with any consumer value. Controls have a 44px minimum height.