Field
Field connects one form control with its label, description, validation state, and error message.
Purpose
Field connects one form control with its label, description, validation state, and error message.
Labeled control
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/fieldImport
import { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity } from "@/components/ui/field";Need the machine-readable source metadata? View registry JSON.
Usage
Use Field for every visible form control. It couples labels, descriptions and errors with the control automatically.
import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
export function Example() {
return (
<Field name="email">
<FieldLabel>Email</FieldLabel>
<Input type="email" />
<FieldDescription>Used for notifications.</FieldDescription>
<FieldError />
</Field>
);
}Examples
States, control variants, validation and practical field patterns are compositions of the same primitive.
Disabled
Invalid
With select
With switch
With textarea
Required
Live validation
FieldControl and FieldValidity expose the live validity state while typing.
Description and error
Form integration
Settings row
Inline field
Field item
FieldItem groups a control with its own text inside a Field.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
Field invalidcontrols the complete external error state for form libraries and keeps label, control, and error presentation synchronized.FieldLabel nativeLabel={false}renders non-native label semantics for button-like controls such as Select triggers, where a native label is not appropriate.FieldItem disableddisables and dims one item inside a larger active group.FieldControlsupports controlledonValueChange(value, eventDetails)in addition to uncontrolleddefaultValue.- Use
FieldValiditywhen rendering validation details from Base UI state.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Field adds no local motion.
- The contained control owns focus, pressed, popup, and validation transitions.
- Error copy may appear without shifting the control itself.
Accessibility
- Every visible control needs a connected
FieldLabelor an accessible label. - Connect descriptions and errors through the Field context rather than manual duplicate IDs.
- Keep invalid state on the Field and control as required by the selected primitive.
- Use
nativeLabel={false}only for non-labelable button-like controls; do not remove a control’s accessible name.
Implementation Guidance
- Use Field as the standard wrapper for one control, label, description, and error.
- Do not render raw inputs without Field or another correctly connected label.
- Prefer Field props and Base UI context to manual validation wiring.