ThiloDesign System
DV

Field

shadcn/ui
v4 only

Form field wrapper — label, description, error. Replaces the old FormField pattern in shadcn v4.

@/components/ui/field

States

StatePreviewToken
Default

One-line summary.

label: text-sm · description: text-muted-foreground
Invalid
data-invalid on Field → label turns text-destructive
Disabled

Auto-generated — cannot be changed.

disabled on Input — opacity-50 from Input styles

Orientations

vertical (default) — label above

horizontal — label beside (checkbox/switch rows)

Notification preferences

In context — new ticket form

New ticket

Sub-components

ComponentRole
FieldRoot wrapper — sets orientation context and data-invalid flag
FieldLabelLabel element — turns red when Field has data-invalid
FieldDescriptionHelper text below input — text-muted-foreground text-sm
FieldErrorError message — shown when data-invalid. accepts errors={[{message}]}
FieldGroupVertical stack of Fields — consistent gap between rows
FieldSetGroups related fields with a legend — renders as <fieldset>
FieldLegendHeading for a FieldSet — renders as <legend>

Field works standalone or with react-hook-form. For RHF: wrap with Controller and pass data-invalid={fieldState.invalid} to Field.

On this page