Button

A basic button component. Supports a minimal level of customization.

You can also build a custom button using Pressable.

import { Button } from 'react-native';

<Button {...props} />;

API #

Props #

accessibilityLabel ?string

Equivalent to aria-label.

color ?string

Default "#2196F3". Set the background color of the button.

disabled ?boolean

Prevent all interactions with the button.

onPress ?(e: ClickEvent) => void

Called when the button is pressed by a pointer or keyboard.

testID ?string

Set the test selector label (via data-testid).

title string

Set the text content of the button.


Examples #

Updated
Edit
React Native for WebCopyright © Nicolas Gallagher and Facebook Inc.