View fulldotdev/ui on GitHub

Label

Renders an accessible label associated with a control.

Installation

npx shadcn@latest add @fulldev/label

Usage

import { Label } from "@/components/ui/label"
<Label for="email">Your email address</Label>

Match for on Label with the control id, or nest the control inside the label.

Label in Field

For form fields with a description or error, use Field and its FieldLabel, FieldDescription and FieldError.

RTL

API Reference

Source: src/components/ui/label

Label renders a native label with data-slot="label" and passes all other attributes through.