Label
An accessible label element that renders text for form controls. Built on Radix UI Label for proper accessibility associations.
Preview
Default Label
Label with Input
Label with Checkbox
Required Label
Usage
tsx
import { Label } from "zostel-ui";
import { Input } from "zostel-ui";
<Label htmlFor="email">Email Address</Label>
<Input id="email" type="email" placeholder="you@zostel.com" />
{/* With required indicator */}
<Label>Phone <span className="text-zostel-orange">*</span></Label>Props
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | — | The ID of the form element this label is for. |
className | string | "" | Additional CSS classes to apply. |
asChild | boolean | false | Render as a child element using Radix Slot. |
htmlForType:
stringDefault: —
The ID of the form element this label is for.
classNameType:
stringDefault: ""
Additional CSS classes to apply.
asChildType:
booleanDefault: false
Render as a child element using Radix Slot.