Label
Use Label to associate readable text with an input. Required fields receive a visible marker.
Preview
import { Input, Label } from "niom-parts";
<Label htmlFor="email" required>Email address</Label>
<Input id="email" type="email" />
Common use cases
Use the state props to keep label styling aligned with its related control.
Preview
Props
| Prop | Type | Default |
|---|---|---|
children | ReactNode | required |
htmlFor | string | - |
required | boolean | - |
disabled | boolean | - |
className | string | - |
forwardedRef | ForwardedRef<HTMLLabelElement> | - |