Form Components
Label
Label associates text with a form control. Wrap an Input or Checkbox to make the label clickable, or use htmlFor when the control sits outside.
Basic usage
A Label defaults to sm size and inheritAppearance appearance, so it picks up text color from its surroundings.
<Label>Email address</Label>Sizes
Labels come in five sizes: xs, sm (default), md, lg, xl. Nested Input and Checkbox controls inherit the size.
<Col> <Label xs>xs label <Input placeholder="xs input" /></Label> <Label>sm label (default) <Input placeholder="sm input" /></Label> <Label md>md label <Input placeholder="md input" /></Label> <Label lg>lg label <Input placeholder="lg input" /></Label> <Label xl>xl label <Input placeholder="xl input" /></Label></Col>Appearances
Labels default to inheritAppearance: they take their color from the surrounding text. Set an explicit appearance to override.
<Row flexWrap> <Label>inheritAppearance label (default)</Label> <Label primary>primary label</Label> <Label accent>accent label</Label> <Label secondary>secondary label</Label> <Label tertiary>tertiary label</Label> <Label success>success label</Label> <Label danger>danger label</Label> <Label warning>warning label</Label> <Label info>info label</Label></Row>Variants
Label never paints a surface, so the variant only picks which colour of the appearance the text is painted in. outline, the default, uses the appearance's own colour. filled uses the "on this fill" colour, for a label sitting on a filled surface of the same appearance. For a filled pill beside a field, reach for Badge or Chip instead.
<Col> <Row flexWrap> <Label success>outline success</Label> <Label danger>outline danger</Label> </Row> <Card success filled wFit> <Label success filled>filled success, on a matching filled Card</Label> </Card></Col>Disabled
disabled dims the label, and a Label containing a disabled control dims with it, so you only have to disable the field itself.
<Col> <Label disabled>Explicitly disabled label</Label> <Label> Email <Input disabled placeholder="you@example.com" /> </Label> <Label row itemsCenter> <Checkbox disabled /> Subscribe to product updates </Label></Col>The dimming applies once: a disabled control inside a dimmed Label is not faded a second time.
With Input
Wrap an Input inside a Label to make the label clickable and associate them implicitly. No htmlFor/id wiring required.
<Col noGap> <Label> Email <Input placeholder="you@example.com" /> </Label></Col>With Checkbox
Place a Checkbox inside a Label so the label text expands the toggle's hit area. Label defaults to a stacked column layout, so add row itemsCenter to sit the checkbox inline with its text.
<Label row itemsCenter> <Checkbox /> Subscribe to product updates</Label>htmlFor association
When the control lives outside the label, use the standard htmlFor attribute pointing at the input's id.
<Col noGap> <Label htmlFor="username">Username</Label> <Input id="username" placeholder="Choose a username" /></Col>Font weights
The default weight is fontMedium. Override with any weight prop from fontThin to fontBlack.
<Col> <Label fontThin>thin weight</Label> <Label fontExtralight>extralight weight</Label> <Label fontLight>light weight</Label> <Label fontNormal>normal weight</Label> <Label>medium weight (default)</Label> <Label fontSemibold>semibold weight</Label> <Label fontBold>bold weight</Label> <Label fontExtrabold>extrabold weight</Label> <Label fontBlack>black weight</Label></Col>Text decorations
Apply text decorations as needed.
<Row flexWrap> <Label underline>underline text</Label> <Label lineThrough>lineThrough text</Label> <Label overline>overline text</Label></Row>Size propagation
When an Input or Checkbox is nested inside a Label, it automatically picks up the label's size. Set it once and everything scales together. Pass a size on the child to opt out for that one element.
<Col> <Label xl row itemsCenter> <Checkbox /> Extra-large checkbox option </Label> <Label lg row itemsCenter> <Checkbox xs /> Explicit <Code>xs</Code> checkbox overrides the <Code>lg</Code> label </Label></Col>Required and status
Use appearances to indicate field status: danger for errors, success for valid, secondary for hints.
<Col> <Col noGap> <Label fontSemibold>Username <Text tag="span" danger>*</Text></Label> <Input placeholder="Choose a username" /> </Col> <Col noGap> <Label success fontSemibold>Email verified</Label> <Input placeholder="verified@example.com" /> </Col> <Label secondary>All fields marked with * are required.</Label></Col>Label Props
| Prop | Category | Default | Description |
|---|---|---|---|
accent | Appearance | Accent color appearance (rose) | |
danger | Appearance | Danger color appearance (red) | |
info | Appearance | Info color appearance (cyan) | |
inheritAppearance | Appearance | ✓ | Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables |
primary | Appearance | Primary color appearance (gray) | |
secondary | Appearance | Secondary color appearance (gray) | |
success | Appearance | Success color appearance (green) | |
tertiary | Appearance | Tertiary color appearance | |
warning | Appearance | Warning color appearance (amber) | |
disabled | Disabled | Disable the component — reduces opacity, changes cursor to not-allowed, and prevents interaction | |
flex1 | Flex | Take up remaining space (= | |
flexAuto | Flex | Grow but respect intrinsic size (= | |
flexNone | Flex | Don't grow and don't shrink (= | |
fontHeading | Font Family | Heading font family (defaults to sans, customizable via --font-heading) — emits font-heading | |
fontMono | Font Family | Monospace font family — emits font-mono | |
fontSans | Font Family | ✓ | Sans-serif font family (default) — emits font-sans |
fontSerif | Font Family | Serif font family — emits font-serif | |
italic | Font Style | Italic font style | |
notItalic | Font Style | Not italic (normal) font style | |
fontBlack | Font Weight | Black font weight (900) — emits font-black | |
fontBold | Font Weight | Bold font weight (700) — emits font-bold | |
fontExtrabold | Font Weight | Extra bold font weight (800) — emits font-extrabold | |
fontExtralight | Font Weight | Extra light font weight (200) — emits font-extralight | |
fontLight | Font Weight | Light font weight (300) — emits font-light | |
fontMedium | Font Weight | ✓ | Medium font weight (500) — emits font-medium |
fontNormal | Font Weight | Normal font weight (400) — emits font-normal | |
fontSemibold | Font Weight | Semibold font weight (600) — emits font-semibold | |
fontThin | Font Weight | Thin font weight (100) — emits font-thin | |
noShrink | Shrink | Prevent the flex item from shrinking below its content size (= | |
lg | Size | Large size | |
md | Size | Medium size (default) | |
sm | Size | ✓ | Small size |
xl | Size | Extra large size | |
xs | Size | Extra small size | |
textCenter | Text Align | Align text to center | |
textEnd | Text Align | Align text to the reading-direction end (right in LTR, left in RTL) | |
textJustify | Text Align | Justify text | |
textLeft | Text Align | Align text to left (physical side, does not flip under RTL) | |
textRight | Text Align | Align text to right (physical side, does not flip under RTL) | |
textStart | Text Align | Align text to the reading-direction start (left in LTR, right in RTL) | |
lineThrough | Text Decoration | Add strikethrough/line-through decoration across text | |
noUnderline | Text Decoration | Remove ALL text-decoration — underline, line-through, and overline (text-decoration: none) | |
overline | Text Decoration | Add overline decoration above text | |
underline | Text Decoration | Add underline decoration below text | |
capitalize | Text Transform | Capitalize first letter of each word | |
lowercase | Text Transform | Transform text to lowercase | |
normalCase | Text Transform | Normal text case (no transformation) | |
uppercase | Text Transform | Transform text to uppercase | |
lineClamp2 | Truncate | Truncate at 2 lines with ellipsis | |
lineClamp3 | Truncate | Truncate at 3 lines with ellipsis | |
lineClamp4 | Truncate | Truncate at 4 lines with ellipsis | |
lineClamp5 | Truncate | Truncate at 5 lines with ellipsis | |
noTruncate | Truncate | Remove truncation | |
truncate | Truncate | Single line truncation with ellipsis | |
filled | Variant | Filled variant - solid background with contrasting text color | |
ghost | Variant | Ghost variant - transparent background, no border, appearance-colored text, tinted hover background | |
outline | Variant | ✓ | Outline variant - transparent background with border and colored text (default) |
Layout & utility props (gap, padding, hide, items, justify, ...) — documented on Common Props
| Prop | Category | Default | Description |
|---|---|---|---|
border | Border | Enable border on all sides | |
borderB | Border | Enable border on bottom | |
borderEnd | Border | Enable border on the inline-end side (right in LTR, left in RTL) | |
borderL | Border | Enable border on left | |
borderR | Border | Enable border on right | |
borderStart | Border | Enable border on the inline-start side (left in LTR, right in RTL) | |
borderT | Border | Enable border on top | |
borderX | Border | Enable border on left and right | |
borderY | Border | Enable border on top and bottom | |
noBorder | Border | Disable all borders | |
cursorDefault | Cursor | ✓ | Default cursor - standard arrow |
cursorMove | Cursor | Move cursor - indicates draggable element | |
cursorNone | Cursor | No cursor - hides the cursor | |
cursorNotAllowed | Cursor | Not-allowed cursor - indicates disabled state | |
cursorPointer | Cursor | Pointer cursor - indicates clickable element | |
cursorText | Cursor | Text cursor - indicates selectable text | |
cursorWait | Cursor | Wait cursor - indicates loading/processing | |
block | Display | Block display - takes full width, new line | |
contents | Display | Contents display - element's box is removed, children display as if parent didn't exist | |
flex | Display | ✓ | Flex display - flexbox container |
grid | Display | Grid display - CSS grid container | |
hidden | Display | Hidden display - element is not visible | |
inline | Display | Inline display - flows with text | |
inlineBlock | Display | Inline-block display - inline but with block properties | |
inlineFlex | Display | Inline-flex display - inline flexbox container | |
inlineGrid | Display | Inline-grid display - inline grid container | |
table | Display | Table display - behaves like table element | |
tableCell | Display | Table-cell display - behaves like td element | |
column | Flex Direction | ✓ | Flex direction column (vertical) |
columnReverse | Flex Direction | Flex direction column-reverse | |
row | Flex Direction | Flex direction row (horizontal) | |
rowReverse | Flex Direction | Flex direction row-reverse | |
gap | Gap | ✓ | Enable gap spacing between children |
noGap | Gap | Disable gap spacing | |
hAuto | Height | Set height to auto | |
hFit | Height | Set height to fit-content | |
hFull | Height | Set height to 100% | |
hScreen | Height | Set height to 100vh (viewport height), removes max-height constraint | |
desktopHide | Hide | Hide element on desktop devices and below (max-desktop: 80rem) | |
mobileHide | Hide | Hide element on mobile devices and below (max-mobile: 48rem) | |
tabletHide | Hide | Hide element on tablet devices and below (max-tablet: 64rem) | |
itemsBaseline | Items | Align items to baseline | |
itemsCenter | Items | Align items to center | |
itemsEnd | Items | Align items to end (bottom/right) | |
itemsStart | Items | ✓ | Align items to start (top/left) |
itemsStretch | Items | Stretch items to fill container | |
justifyAround | Justify | Distribute items with space around them | |
justifyBaseline | Justify | Align items along their baseline on main axis | |
justifyBetween | Justify | Distribute items with space between them | |
justifyCenter | Justify | Center items along the main axis | |
justifyEnd | Justify | Pack items toward the end of the main axis | |
justifyEvenly | Justify | Distribute items with equal space around them | |
justifyStart | Justify | Pack items toward the start of the main axis | |
justifyStretch | Justify | Stretch items to fill the main axis | |
overflowAuto | Overflow | Auto overflow - show scrollbars if needed | |
overflowClip | Overflow | Clip overflow - hard clip without scrollbars | |
overflowHidden | Overflow | Hidden overflow - clip content without scrollbars | |
overflowScroll | Overflow | Scroll overflow - always show scrollbars | |
overflowVisible | Overflow | Visible overflow - content extends beyond bounds | |
overflowXAuto | Overflow | Auto overflow on X-axis only | |
overflowXClip | Overflow | Clip overflow on X-axis only | |
overflowXHidden | Overflow | Hidden overflow on X-axis only | |
overflowXScroll | Overflow | Scroll overflow on X-axis only | |
overflowXVisible | Overflow | Visible overflow on X-axis only | |
overflowYAuto | Overflow | Auto overflow on Y-axis only | |
overflowYClip | Overflow | Clip overflow on Y-axis only | |
overflowYHidden | Overflow | Hidden overflow on Y-axis only | |
overflowYScroll | Overflow | Scroll overflow on Y-axis only | |
overflowYVisible | Overflow | Visible overflow on Y-axis only | |
absolute | Position | Absolute positioning | |
fixed | Position | Fixed positioning | |
relative | Position | Relative positioning | |
static | Position | Static positioning | |
sticky | Position | Sticky positioning | |
responsiveSizing | Responsive Sizing | Enable responsive sizing - uses breakpoint-specific classes for font size, padding, and gap | |
insetRing | Ring | Enable the inset ring — emits ring-inset | |
noInsetRing | Ring | Disable the inset ring | |
noShadow | Shadow | Disable drop shadow | |
shadow | Shadow | Enable drop shadow | |
wAuto | Width | Set width to auto | |
wFit | Width | Set width to fit-content | |
wFull | Width | Set width to 100% | |
wScreen | Width | Set width to 100vw (viewport width), removes max-width constraint | |
flexNoWrap | Wrap | Force flex items to stay on single line (may overflow) | |
flexWrap | Wrap | Allow flex items to wrap to new lines when container is too narrow | |
flexWrapReverse | Wrap | Wrap flex items in reverse order (last items wrap first) |