Tessina UI
ConfiguratorGitHubIntroduction
InstallationUsageTheming
ComponentsAccordionAction SheetAlertAlertDialogArea ChartAspectRatioAvatarBadgeBannerBar ChartBottom NavBreadcrumbButtonButtonGroupCalendarCardCarouselChartChatBubbleCheckboxChipCodeBlockCollapsibleColor PickerComboboxCommandContainerContextMenuDate PickerDividerDrawerDropdown MenuEmptyStateFABFieldFieldsetFile UploadFile Upload 2FlexFormGridHoverCardIconButtonLabelLine ChartLinkMenubarMeterModalNavigation MenuNumberFieldOTP InputPaginationPie ChartPopoverProgressPromptInputRadar ChartRadial ChartRadioRatingScroll AreaSearchSegmentedControlSelectShortcutSidebarSkeletonSliderSpacerSpinnerSplit ButtonStackStatusStepperSurfaceSwitchTableTabsTextareaTime PickerToastToggleButtonToggleGroupToolbarTooltipTop Header DesktopTop Header Mobile
Contributing
Components

Label

A foundational form label primitive. Five sizes, five intents, three tones, three weights, required/optional indicators, leading/trailing icons, optional description, and RTL support.

Playground

Installation

pnpm add @tessinaui/ui

Usage

import { Label } from "@tessinaui/ui";
<Label htmlFor="email">Email address</Label>
<input id="email" type="email" />

Examples

Default

A basic label associated with a control via htmlFor.

Sizes

Five size scales — xs, sm, md, lg, and xl — matching Button and Field sizing.

Intents

Use intent to communicate validation state — error, warning, success, and info.

Required and optional

Mark fields with required or optional indicators after the label text.

With icon

Add a leadingIcon (or trailingIcon) beside the label text.

With description

Provide helper text below the label via the description prop.

Sizes

Matches Button / Field sizing so labels line up with adjacent inputs.

SizeText classUse case
xstext-xsDense forms, inline filters
smtext-xsCompact forms
mdtext-smDefault — matches md inputs
lgtext-smLarge forms, settings panels
xltext-baseHero inputs, auth flows

Intents

Use intent to communicate validation state. Any non-none intent overrides the tone.

IntentTokenTypical use
noneinherits toneDefault
errortext-errorField failed validation
warningtext-warningField needs attention
successtext-successField passed validation
infotext-infoInformational hint

Tones

Controls the base colour when intent="none".

ToneTokenUse case
defaulttext-foregroundStandard on light/background surfaces
mutedtext-muted-foregroundDe-emphasised fields (e.g. optional)
on-colortext-backgroundDark surfaces / inverted themes

Required and optional indicators

<Label required>Full name</Label>
<Label optional>Middle name</Label>

Pass requiredIndicator or optionalIndicator to override the default markers (* and (optional)). Indicators are flagged aria-hidden — pair the label with an aria-required or required attribute on the associated control so screen readers announce the state.

<Label htmlFor="pwd" required>Password</Label>
<input id="pwd" type="password" required aria-required="true" />

Icons and description

<Label leadingIcon={<Mail />} description="We'll never share your email.">
  Email address
</Label>

The description renders below the label text and inherits the disabled state.

Disabled

<Label disabled>Unavailable option</Label>

disabled visually mutes the label (including any required/optional indicators). Use it when the associated control is disabled — the attribute does NOT disable the underlying input itself.

RTL

Pass dir="rtl" to flip icon and indicator alignment via logical spacing (ms-*).

<Label dir="rtl" required leadingIcon={<Mail />}>
  البريد الإلكتروني
</Label>

Accessibility

  • Renders a native <label> element — clicking the label focuses the control referenced by htmlFor.
  • Required and optional indicators are aria-hidden="true". Communicate required state on the associated input itself via required / aria-required.
  • Keep label text concise and always visible; avoid placeholder-only labels.
  • When the label describes a group of controls (checkbox group, radio group), prefer a <legend> inside a <fieldset> rather than a standalone Label.

API Reference

Label

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg" | "xl""md"Size scale
intent"none" | "error" | "warning" | "success" | "info""none"Validation state. Overrides tone when not none.
tone"default" | "muted" | "on-color""default"Base colour tone
weight"normal" | "medium" | "semibold""medium"Font weight
requiredbooleanfalseShow a required indicator after the label
optionalbooleanfalseShow an "(optional)" indicator (ignored if required)
requiredIndicatorReactNode"*"Custom required marker
optionalIndicatorReactNode"(optional)"Custom optional marker
disabledbooleanfalseVisually mute the label
leadingIconReactNode—Icon before the label text
trailingIconReactNode—Icon after the label text (and after indicators)
descriptionReactNode—Helper text rendered below the label
htmlForstring—Native for attribute — associates the label with a control
dir"ltr" | "rtl"—Text direction
classNamestring—Extra classes on the root <label> element

The component extends all standard <label> HTML attributes.

IconButton

A square button that renders a single icon, with optional external label and notification badge.

Line Chart

Token-driven line chart built on Recharts v3 with single and multi-series support, point markers, dashed strokes for non-color differentiation, and full light/dark theming.

On this page

PlaygroundInstallationUsageExamplesDefaultSizesIntentsRequired and optionalWith iconWith descriptionSizesIntentsTonesRequired and optional indicatorsIcons and descriptionDisabledRTLAccessibilityAPI ReferenceLabel