Label
Renders an accessible label associated with controls.
Examples
Regular
Preview
Block
When block is true, the label displays as a bordered block with padding, useful for card-style labels or form sections (e.g. with Switch and description).
Preview
API
Root
Contains the content for the label.
| Property | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Change the default rendered element for the one passed as a child, merging their props and behavior. |
| htmlFor | string | - | The id of the element the label is associated with. |
| variant | ”regular" | "regular” | The visual style of the label. |
| size | ”sm” | “md” | “lg" | "md” | The size of the label. |
| block | boolean | false | When true, displays the label as a block with border, padding, and full-width layout (items-start, justify-between). Useful for card-style or form section labels. |
Last updated on