Label
A styled Radix UI label wrapper with automatic peer-disabled state handling.
Preview
Installation
npx shadcn@latest add @shadszn/labelUsage
import { Label } from "@/components/ui/label"
import { Input } from "@/components/ui/input"
export default function Example() {
return (
<div className="space-y-1.5">
<Label htmlFor="email">Email</Label>
<Input id="email" type="email" placeholder="you@example.com" />
</div>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| htmlFor | string | --- | Associates the label with a form element by id. |
| className | string | --- | Additional CSS classes. |