Label
Names a form control. Clicking the label focuses the control. Add required to show the asterisk.
Installation
npx shadcn@latest add @sevenone/labelUsage
import { Label } from "@/components/ui/label"Examples
Default and required
<Label htmlFor="company">Company</Label>
<Label htmlFor="email" required>Email address</Label>Accessibility
- The asterisk is decorative (aria-hidden); also set required on the input.
- Text is 16px and 7:1.