Skip to main content

Field

A field wraps form inputs with labels, descriptions, and error messages.

On this page

Installation

npx shadcn@latest add @dotui/field

Usage

import { Field, Label, Description, FieldError } from '@/components/ui/field'
<Field>
  <Label>Email</Label>
  <Input type="email" />
  <Description>We'll never share your email.</Description>
</Field>

Examples

No examples yet.

API Reference

Field

A field wraps a form control with its label, description, and error message.

Supports all div attributes.

PropType
"horizontal" | "vertical"

Fieldset

Groups a set of related fields under a common legend.

Supports all fieldset attributes.

PropType

Legend

The caption of a fieldset, describing its group of fields.

Supports all legend attributes.

PropType

FieldGroup

Contains a stack of fields, applying consistent spacing between them.

Supports all div attributes.

PropType

FieldContent

Contains the label and description of a field, displayed alongside its control.

Supports all div attributes.

PropType

Label

The label of a field.

PropType

Description

The description of a field. Provides a hint or additional context for the control.

PropType

FieldError

A FieldError displays validation errors for a form field.

PropType
ReactNode | function
string

Last updated on 6/16/2026