Label
Renders an accessible label associated with form controls.
Installation
import { Label } from "@sourceful-energy/ui"Usage
Examples
With Input
With Checkbox
Required Field
With Helper Text
Your API key can be found in settings.
Disabled State
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| htmlFor | string | - | The id of the element the label is associated with. |
| className | string | - | Additional CSS classes. |
Accessibility
- Built on Radix UI Label for proper accessibility
- Clicking the label focuses the associated control
- Screen readers announce the label with the control
- Always use htmlFor to associate with form controls