Label
Accessible form labels. Link text to inputs. Boost completion rates.
Installation
pnpm dlx nachui add labelAnatomy
Variants
Default
A label paired with an input.
Required & Optional
Use
required to show a red asterisk, optional to show "(optional)" text, and description for helper text.Printed on every invoice we send you.
API Reference
Label
| Prop | Type | Default | Description |
|---|---|---|---|
required | boolean | — | Shows a red * indicator next to the label text. |
optional | boolean | — | Shows "(optional)" text next to the label. |
description | string | — | Helper text displayed below the label. |
htmlFor | string | — | Associates the label with a form element. |
className | string | — | Additional CSS class names. |
children | React.ReactNode | — | The label content. |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.