Label
Base UIAn accessible name connected to a form control.
ReadyResponsive
Usage
Package export"use client"
import { Checkbox } from "@jnpll/elements-ui/checkbox"
import { Label } from "@jnpll/elements-ui/label"
export default function LabelDemo() {
return (
<div className="flex gap-2">
<Checkbox id="terms" />
<Label htmlFor="terms">Accept terms and conditions</Label>
</div>
)
}
Examples
Default composition
"use client"
import { Checkbox } from "@jnpll/elements-ui/checkbox"
import { Label } from "@jnpll/elements-ui/label"
export default function LabelDemo() {
return (
<div className="flex gap-2">
<Checkbox id="terms" />
<Label htmlFor="terms">Accept terms and conditions</Label>
</div>
)
}
API Reference
| Prop | Type / description | Default |
|---|---|---|
children | ReactNodeComponent content and composition slots. | - |
className | stringAdditional classes, merged with the component styles. | - |
Composition & accessibility
Import the composition slots shown in the example. Keep labels and descriptions meaningful; interactive primitives provide keyboard and focus behavior. See the source for the complete typed API.