Tessina UI
Tessina UI
GitHubIntroduction
InstallationUsageTheming
Components
ButtonIconButtonLinkSpinnerBadgeAvatarStatusChipShortcutSkeletonSurfaceProgressMeterRating
LabelFieldFieldsetCheckboxRadioSwitchSliderSelectComboboxSearchTextareaNumberFieldDate PickerTime PickerOTP InputFile UploadCalendar
AlertBannerToastTooltip
TabsAccordionCollapsibleBreadcrumbPaginationStepperSegmentedControlButtonGroupToggleButtonToggleGroupToolbarNavigation MenuMenubarBottom NavSidebar
Split ButtonFABDropdown MenuContextMenuCommandPopoverHoverCard
ContainerStackFlexGridAspectRatioSpacerCardCarouselDividerScroll Area
Table
ChatBubblePromptInputCodeBlock
ModalAlertDialogDrawerAction SheetTop Header MobileTop Header DesktopEmptyStateForm
Contributing
ComponentsForm Blocks

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" />

Showcase

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.

Rating

Captures user sentiment in four patterns — star scale, numeric NPS scale, emoji reaction picker, and binary thumbs — with full intent palette, half-star precision, RTL support, and keyboard navigation.

Field

A text input field with a label, helper text, FieldDropdown prefix, Button suffix, leading/trailing icon buttons, a clearable button, and a character counter. Supports all intent states and full RTL layout.

On this page

PlaygroundInstallationUsageShowcaseSizesIntentsTonesRequired and optional indicatorsIcons and descriptionDisabledRTLAccessibilityAPI ReferenceLabel