Components/Label
Label
An accessible form label that wraps a native <label> element, with optional required and disabled states.
import { Label } from "@animui/ui"Basic
Required
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Label text or content. |
htmlFor | string | — | ID of the form control this label is associated with. |
required | boolean | false | Renders a red asterisk to mark the field as required. |
disabled | boolean | false | Dims the label and shows a not-allowed cursor. |
className | string | — | Additional classes for the label element. |
Accessibility
- ✓Renders a native
<label>so clicking it focuses the associated control. - ✓Always pass
htmlFormatching the input'sidto keep the association explicit for screen readers. - ✓The required asterisk is visual only; pair it with the input's
requiredattribute for assistive tech.