Skip to content

Label Primitive

A user-friendly label linked to controls for improved accessibility.

Install the component via your command line.

Terminal window
npx expo install @rn-primitives/label
import * as LabelPrimitive from '@rn-primitives/label';
function Example() {
const [checked, setChecked] = React.useState(false);
return (
<Label.Root>
<Label.Text
nativeID='to-be-use-by-aria-labelledby-from-form-field'
>
Label
</Label.Text>
</Label.Root>
);
}

Extends Pressable props except children | hitSlop | style

PropTypeNote
children*React.ReactNode
styleViewStyle(optional)

Extends Text props

PropTypeNote
nativeID*stringthe same value needs be use by aria-labelledby from form field
htmlForstringweb only