Label

An accessible label linked to a form control.
Stable
Web
iOS
Android
@advui/core
Source

Labelling controls

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { Checkbox, HStack, Label } from '@advui/core'

<HStack gap="2">
  <Checkbox id="newsletter" />
  <Label htmlFor="newsletter">Subscribe to the newsletter</Label>
</HStack>

API reference

Label

PropTypeDefaultDescription
htmlForstring—The `id` of the control it labels.
requiredbooleanfalseShows a visual “*” (mark the input itself `required`).
disabledbooleanfalseDims the label to match a disabled control.

Accessibility

  • On web renders <label for>, giving the control its accessible name and a larger click target.
  • On native, pressing the label focuses (inputs) or toggles (checkbox/switch) the linked control, and its text is the control’s name unless the control has an aria-label; the label is then hidden from screen readers so it is not read twice.
Since v0.1.0Last updated Nov 2, 2026Edit this page on GitHub