API and Development
Label provides accessible labels for form controls, helping users understand what information is expected and ensuring proper association between labels and their inputs. It displays descriptive text associated with form fields, supporting semantic color variants and inline layouts. Built on Radix UI's Label component, it ensures proper accessibility and visual consistency across the interface.
Name | Type | Default | Description |
|---|---|---|---|
|
| — | Action {@link Button} to render next to the label. Ignored when |
|
| — | When true, applies an active/pressed visual state. |
|
|
| HTML element tag to render. |
|
| — | When true, disables interaction and applies a disabled visual state. |
|
| — | URL for anchor-based interactables. Changes the rendered element to an |
|
| — | Choose to inject interactivity into a child element such as a Div element |
|
|
| When true, renders the label inline without a block-level line break. |
|
|
| Visual style variant for the interactive element. |
|
|
| When true, renders a required asterisk after the label text. The associated form control must
also set |
|
| — | Target for anchor-based interactables (for example |
|
| — | Optional tooltip text to display on hover (uses Radix Tooltip) |
|
| — | Position of the tooltip relative to the element, defaults to "top" |
|
|
| Font weight for the label. |
Interactive examples and edge cases for this component are in Storybook.
Default appearance for standard form labels.
Use color variants to communicate validation state or semantic meaning.
Indicates a positive state or successful validation.
Highlights attention or caution without indicating an error.
Signals validation errors or required attention.
Use the action prop to place a link Button at the trailing edge of a block label row—for example, "Forgot password?" beside a password field. The action is ignored when inline is set.
Use inline labels when space is limited or when the label and control should appear on the same line.
Use disabled labels when the associated form control is unavailable.
Labels work seamlessly with various form controls throughout the platform.
Use labels consistently within forms to provide clear guidance.