Tally UI
Primitives

Label

An accessible text label that associates with a form control via nativeID.

Import

import { Label } from '@tallyui/primitives';

Usage

<Label.Root nativeID="email-input">Email address</Label.Root>

Associate the label with a control by setting the same nativeID on both the label and the input's accessibilityLabelledBy prop.

Components

Label.Root

Renders a text element with accessibility semantics for labeling form controls.

PropTypeDefaultDescription
nativeIDstringLinks this label to a form control
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native TextProps.

Accessibility

  • Maps to a <label> element on web
  • Use nativeID to create a programmatic association with form controls

On this page