Components › Forms
Label and Field
A form label, and Field: label, control and hint or error in one, wired together for screen readers.
Installation
npx plankui@latest add labelUsage
import { Label } from "@/components/ui/label";
<Field label="Email" hint="We only use this for receipts." error={error}>
<Input type="email" />
</Field>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | Shown above the control and linked to it. | |
| hint | ReactNode | Help text below the control, linked with aria-describedby. | |
| error | ReactNode | Replaces the hint in red and marks the control invalid. | |
| htmlFor | string | The control's id. Leave it out and Field assigns one. |