Core Components
Label
Renders an accessible label associated with controls.
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
export function LabelDemo() {
return (
<div className="flex gap-2">
<Checkbox id="terms" />
<Label htmlFor="terms">Accept terms and conditions</Label>
</div>
)
}Installation
Install with the shadcn CLI. An AI assistant with the shadcn MCP server configured can also install components automatically when you ask for them (see Getting Started).
npx shadcn@latest add labelDocumentation
For all options, variants and the full API, see the shadcn/ui docs and the Base UI API reference.
Last updated on