Nusa UINusa UI

Renders an accessible label associated with controls.

registry/examples/label-demo.tsx
import { Label } from "@/registry/ui/label"

export default function LabelDemo() {

Installation

pnpmnpmyarnbun
pnpm dlx shadcn@latest add https://nusa-ui.vercel.app/r/label.json

Usage

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

Examples

With Input

registry/examples/label-with-input.tsx
import { Input } from "@/registry/ui/input"
import { Label } from "@/registry/ui/label"

With Checkbox

registry/examples/label-with-checkbox.tsx
import { Checkbox } from "@/registry/ui/checkbox"
import { Label } from "@/registry/ui/label"

API Reference

Label

PropTypeDefaultDescription
htmlForstring-The id of the element the label is associated with