Skip to main content

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​

PropTypeDefault
childrenReactNoderequired
htmlForstring-
requiredboolean-
disabledboolean-
classNamestring-
forwardedRefForwardedRef<HTMLLabelElement>-