Label

A styled Radix UI label wrapper with automatic peer-disabled state handling.

Preview

Installation

npx shadcn@latest add @shadszn/label

Usage

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

PropTypeDefaultDescription
htmlForstring---Associates the label with a form element by id.
classNamestring---Additional CSS classes.