98.6k

Label

PreviousNext

Renders an accessible label associated with controls.

import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"

export function LabelDemo() {
  return (
    <div>
      <div className="flex items-center space-x-2">
        <Checkbox id="terms" />
        <Label htmlFor="terms">Accept terms and conditions</Label>
      </div>
    </div>
  )
}

Installation

pnpm dlx shadcn@latest add label

Usage

import { Label } from "@/components/ui/label"
<Label htmlFor="email">Your email address</Label>