Search documentation

Search components and pages

Label

An accessible label associated with controls.

01

Installation

Add the label component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/label.json
02

Usage

tsx
import { Label } from "@/components/ui/label"
03

Examples

Default

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

<div className="flex items-center gap-2">
  <Checkbox id="terms" defaultChecked />
  <Label htmlFor="terms">Accept terms and conditions</Label>
</div>