Label
Small, bold, uppercase, widely tracked label. Pass htmlFor to get a real <label> for a form control; without it you get a <span>.
Plain label (a span)
Props
htmlForstringid of the control this labels; renders a <label> when set.
asElementTypeElement to render (default: label with htmlFor, otherwise span).
classNamestringDefault:''Extra classes for the root element.
childrenReactNodeContent.
...restAny other props are passed to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | – | id of the control this labels; renders a <label> when set. |
as | ElementType | – | Element to render (default: label with htmlFor, otherwise span). |
className | string | '' | Extra classes for the root element. |
children | ReactNode | – | Content. |
...rest | – | Any other props are passed to the underlying element. |