Label
Accessible form label for pairing with inputs, checkboxes, selects, and other form controls.
Preview
Installation
npx drivn add labelUsage
1 import { Label } from "@/components/ui/label" 2 3 export default function Page() { 4 return ( 5 <Label htmlFor="email">Email</Label> 6 ) 7 }
With Input
With Checkbox
With Select
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | — | ID of the form element the label is associated with |
className | string | — | Additional CSS classes to apply |
children | ReactNode | — | Label text or content |
...props | LabelHTMLAttributes | — | All standard HTML label attributes are supported |