Label
An accessible label for form controls, set in the macOS body text style.
@cupertinoui/labelRegistry JSON "use client"
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
export default function LabelDemo() {
return (
<Label>
<Checkbox defaultChecked /> Show hidden files
</Label>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/labelThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { Label } from "@/components/ui/label"
<Label htmlFor="name">Name:</Label>API Reference
Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.
Label
| Prop | Type | Description |
|---|---|---|
htmlFor | string | The id of the control the label belongs to. |
className | string | Extra classes, merged with the component's own. |