This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 55).
Button
A pressable button with multiple visual variants.
Android
iOS
Web
Included in Expo Go
For the complete documentation index, see llms.txt. Use this file to discover all available pages.
A pressable button that renders consistently across Android, iOS, and web. Supports filled, outlined, and text visual variants.
Installation
Terminal
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic button
BasicButtonExample.tsx
import { Host, Button } from '@expo/ui'; export default function BasicButtonExample() { return ( <Host matchContents> <Button label="Press me" onPress={() => alert('Pressed!')} /> </Host> ); }
Variants
Pick a visual variant with the variant prop.
ButtonVariantsExample.tsx
import { Host, Column, Button } from '@expo/ui'; export default function ButtonVariantsExample() { return ( <Host matchContents> <Column spacing={8}> <Button variant="filled" label="Filled" onPress={() => {}} /> <Button variant="outlined" label="Outlined" onPress={() => {}} /> <Button variant="text" label="Text" onPress={() => {}} /> </Column> </Host> ); }
Custom content
Pass children for fully custom button contents. The label prop is ignored when children is provided.
CustomButtonExample.tsx
import { Host, Button, Row, Icon, Text } from '@expo/ui'; export default function CustomButtonExample() { return ( <Host matchContents> <Button onPress={() => {}}> <Row spacing={6} alignment="center"> <Icon name={Icon.select({ ios: 'star.fill', android: require('@expo/material-symbols/star.xml'), })} size={16} color="#FFFFFF" /> <Text textStyle={{ color: '#FFFFFF' }}>Favorite</Text> </Row> </Button> </Host> ); }
Disabled
DisabledButtonExample.tsx
import { Host, Button } from '@expo/ui'; export default function DisabledButtonExample() { return ( <Host matchContents> <Button label="Disabled" onPress={() => {}} disabled /> </Host> ); }
API
import { Button } from '@expo/ui';
No API data file found, sorry!