This page as markdown: /label.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

Label

Status: stable

Styled native

Keywords: label, form label, control, accessibility

Usage

Use Label to name a form control and create a clear accessible relationship with that control.

Best practices

Props

Name Type Default Description
htmlFor string — Associates the label with a control by its id (native
size "xs" | "sm" | "md" | "lg" "lg" Paired label typography step, all sentence case. xs is simply the smallest; for an uppercase eyebrow use eyebrow.
eyebrow boolean false Set the label as an eyebrow: the uppercase, letter-spaced text-overline tier (themeable to sentence case). Replaces size. For a kicker above a group, not an ordinary field label.
hint ReactNode — When set, the label gets a dotted-underline affordance and reveals this content in a tooltip on hover/focus.
className string — Merge or override classes via cn().

Variants

Tokens used

foreground, muted-foreground

Accessibility

Related

Examples

With control

import { Input, Label, Stack } from "@sableui/react"

<Stack gap={1}><Label htmlFor="name">Display name</Label><Input id="name" /></Stack>

In a form

import { Field, Input } from "@sableui/react"

<Field label="Display name" disabled><Input /></Field>

With hint

import { Label } from "@sableui/react"

<Label htmlFor="discount" hint="Taken off every order this code is used on.">Discount</Label>