Field
A layout wrapper for form controls with label, description, and error message slots.
field-demo.app
We'll never share your email.
Installation
terminal.sh
npx y2kui@latest add fieldUsage
import { Field, FieldLabel, FieldControl, FieldDescription, FieldError } from "@/components/ui/field"
<Field>
<FieldLabel htmlFor="email">Email</FieldLabel>
<FieldControl>
<Input id="email" />
</FieldControl>
<FieldDescription>We'll never share your email.</FieldDescription>
<FieldError>Email is required.</FieldError>
</Field>Props
| Prop | Type | Default | Description |
|---|---|---|---|
error | string | — | Shows error state on the input when set. |
FieldLabel | ReactNode | — | Label for the form control. |
FieldDescription | ReactNode | — | Helper text below the control. |
FieldError | ReactNode | — | Error message in pink. |