ZUI

Search documentation

Find a page or a heading.

Label

The text that names a field, with a nativeID for the field's aria-labelledby on Android and an onPress that focuses it.

Installation

bash

The CLI writes components/ui/label.tsx, installs Text and Utils, and adds @rn-primitives/label.

Usage

tsx
tsx

React Native has no link between a label and its field. On Android a field takes the label's text as its name when its aria-labelledby holds the label's nativeID. iOS ignores aria-labelledby, so give the field the same name in aria-label as well. Pressing a Label runs only its onPress, so point that at the field's focus().

API reference

Label

Takes every prop of the @rn-primitives/label root, plus:

disabled dims the label to match a disabled field. It does not block presses.