Label form elements with accessibility.
Based on Radix for great fundamentals.
Supports nested controls and custom controls.
Sizable and stylable inline.
import { Label } from 'tamagui'export default () => (<><Label htmlFor="name">Name</Label><Input id="name" defaultValue="Nate Wienert" /></>)
Use with Input or other form elements to automatically get correct labelling by id and aria-labelledby. You can also use the provided useLabelContext
hook to build your own controls.
Labels extend Stack views inheriting all the Tamagui standard props, plus:
Prop | Type | Default |
---|---|---|
htmlFor* | string | |
Matching to an Input or Switch id. |