Usage
Examples
With checkbox
With switch
Props
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | - | The id of the element this label is associated with |
className | string | - | Additional CSS classes to apply |
children | ReactNode | - | The label text content |
import { Label } from "src/design/product/components/Label";import { Label } from "src/design/product/components/Label";import { Input } from "src/design/product/components/Input";
export default function LabelDemo() { return ( <div className="flex flex-col gap-2"> <Label htmlFor="email">Email address</Label> <Input id="email" type="email" placeholder="you@example.com" /> </div> );}import { Label } from "src/design/product/components/Label";import { Checkbox } from "src/design/product/components/Checkbox";
export default function LabelCheckboxDemo() { return ( <div className="flex items-center gap-2"> <Checkbox id="terms" /> <Label htmlFor="terms">Accept terms and conditions</Label> </div> );}import { Label } from "src/design/product/components/Label";import { Switch } from "src/design/product/components/Switch";
export default function LabelSwitchDemo() { return ( <div className="flex items-center gap-2"> <Switch id="notifications" /> <Label htmlFor="notifications">Enable notifications</Label> </div> );}| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | - | The id of the element this label is associated with |
className | string | - | Additional CSS classes to apply |
children | ReactNode | - | The label text content |