Label
Names a control. Built on ui-sdk's Label: point htmlFor at the control's id and a press on the label focuses it, for any control, not only native inputs.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Label } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
children
required
optional
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use Field's label for a form control. Use Label on its own only for a control outside a Field, and point htmlFor at the control's id. |
| Do | Mark the control itself required as well. The label's asterisk is visual only, so a screen reader learns it from the control. |
| Do | Set optional on the few fields a lawyer can skip when most of a form is required. Screen readers hear "Optional" as part of the name. |
| Don't | Type the asterisk or "(optional)" into the label text. Use required or optional, so every form shows them the same way. |
| Don't | Use a placeholder instead of a label. It disappears once someone types, and the control loses its name. |
Props
Also takes every prop of ui-sdk's Label, including htmlFor.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| required | boolean | false | Shows the red asterisk. Mark the control itself required too; the asterisk is visual only. |
| optional | boolean | false | Shows a muted "Optional", which screen readers hear as part of the name. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { Label } from "@leap-crm/design-system";
<Label>Full name</Label>


