field-demo
Installation
pnpm dlx shadcn@latest add https://ui.n2020.com/r/field.jsonUsage
import {
Field,
FieldDescription,
FieldError,
FieldLabel,
} from "@/components/ui/field";<Field>
<FieldLabel htmlFor="name">Full name</FieldLabel>
<Input id="name" />
<FieldDescription>The courier sees this name.</FieldDescription>
<FieldError>Enter your full name.</FieldError>
</Field>Examples
Invalid
Set data-invalid on Field and aria-invalid on the control.
field-invalid
Horizontal
Set orientation="horizontal" to put the control beside its label. Wrap the label and the description in FieldContent.
field-horizontal