Label

Form label on Radix Label that dims itself beside a disabled control.

Installation

pnpm dlx shadcn@latest add @ward/label

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/label.json

Usage

import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
<div className="grid gap-2">
  <Label htmlFor="email">Email</Label>
  <Input id="email" type="email" placeholder="you@example.com" />
</div>

Props

PropTypeDefaultDescription
htmlForstring-Id of the control the label describes; clicking the label focuses that control.
asChildbooleanfalseRender the child element with label styles instead of a label.
data-disabled"true"-Set on a parent with the group class to dim the label; a disabled control that comes first and has the peer class does the same.

Ward · Version 1.0.0 · Registry manifest