videorc/ui

Label

The 14 px medium label for a control. It dims with a disabled peer and keeps the desktop's arrow cursor.

Installation

$ pnpm dlx shadcn@latest add @videorc/label

Usage

import { Label } from "@/components/ui/label";
<div className="flex items-center gap-2">
  <Checkbox id="include-markers" />
  <Label htmlFor="include-markers">Include markers in the export</Label>
</div>

Inside a Field, use FieldLabel instead: it points at the Field's control on its own.

Theming

Token or attributeMeaning
text-sm, font-medium14 px, medium weight
peer-disabledDims to 50% beside a disabled peer control
data-disabled="true" on a groupDims and stops pointer events
data-slot="label"The label, for styling from a parent

Accessibility

Point htmlFor at the control's id. For a Checkbox or Switch, the id lands on Base UI's hidden input: a click on the label toggles the control, and Base UI names the control by the label.

API reference

Every <label> attribute.