Label
An accessible <label> element built on Radix UI’s Label primitive. Clicking the label focuses the associated input.
Import
import { Label } from "@phpcreation/frontend-components-react-nextjs-bundle/components/Label";Props
All Radix UI Label props, including standard HTML <label> attributes:
| Prop | Type | Description |
|---|---|---|
htmlFor | string | Associates label with an input by its id |
asChild | boolean | Render as child element |
Usage
import { Label } from "@phpcreation/frontend-components-react-nextjs-bundle/components/Label";
import { Input } from "@phpcreation/frontend-components-react-nextjs-bundle/components/Input";
<div className="flex flex-col gap-1">
<Label htmlFor="email">Email Address</Label>
<Input id="email" type="email" />
</div>Notes
- Used internally by
Input,Textarea,BooleanToggle,ColorPicker, andTimePicker - For most cases, use
InputorTextareadirectly (they include a label prop)
Related
Last updated on