Label
Renders a text label for form fields and UI elements.
Usage
import {Label} from "@/components/ui/label";
<Label>Username</Label>;
Props
Label
Prop | Type | Default | Description |
---|---|---|---|
asChild | boolean | false | If true, clones props to the nearest child instead of rendering Text . |
className | string | - | Additional Tailwind classes to merge into the label. |
children | React.ReactNode | - | Content to render inside the label. |
Also extends all React Native Text
props.
Accessibility
- Respects disabled peer styles via
peer-disabled:*
utilities.
Styling
Label uses Tailwind Variants with the following base classes:
text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70