Reference version

Button

Jetpack Compose Button components for displaying native Material3 buttons.

Android
Bundled version:
~55.0.3

Expo UI provides five button components that match the official Jetpack Compose Button API: Button (filled), FilledTonalButton, OutlinedButton, ElevatedButton, and TextButton. All variants share the same props and accept composable children for content.

TypeAppearancePurpose
FilledSolid background with contrasting text.High-emphasis buttons for primary actions such as "submit" and "save."
Filled tonalBackground color varies to match the surface.Also for primary or significant actions. Filled tonal buttons provide more visual weight and suit functions such as "add to cart" and "Sign in."
ElevatedStands out by having a shadow.Serves a similar purpose to tonal buttons. Increase elevation to make the button appear even more prominently.
OutlinedFeatures a border with no fill.Medium-emphasis buttons, containing actions that are important but not primary. They pair well with other buttons to indicate alternative, secondary actions like "Cancel" or "Back."
TextDisplays text with no background or border.Low-emphasis buttons, ideal for less critical actions such as navigational links, or secondary functions like "Learn More" or "View details."

Installation

Terminal
- npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Basic button

A filled button is the default, high-emphasis button for primary actions.

BasicButtonExample.tsx
import { Host, Button, Text } from '@expo/ui/jetpack-compose'; export default function BasicButtonExample() { return ( <Host matchContents> <Button onClick={() => alert('Pressed!')}> <Text>Press me</Text> </Button> </Host> ); }

Button variants

Use different button components to convey varying levels of emphasis.

ButtonVariantsExample.tsx
import { Host, Button, FilledTonalButton, OutlinedButton, ElevatedButton, TextButton, Column, Text, } from '@expo/ui/jetpack-compose'; export default function ButtonVariantsExample() { return ( <Host matchContents> <Column verticalArrangement={{ spacedBy: 8 }}> <Button onClick={() => {}}> <Text>Filled</Text> </Button> <FilledTonalButton onClick={() => {}}> <Text>Filled Tonal</Text> </FilledTonalButton> <OutlinedButton onClick={() => {}}> <Text>Outlined</Text> </OutlinedButton> <ElevatedButton onClick={() => {}}> <Text>Elevated</Text> </ElevatedButton> <TextButton onClick={() => {}}> <Text>Text</Text> </TextButton> </Column> </Host> ); }

Button with icons

Since buttons accept composable children, you can add leading and trailing icons using the Icon component. This follows the Material 3 buttons with icon pattern (official sample), use 18dp icon size, 8dp spacing between the icon and label.

ButtonWithIconsExample.tsx
import { Host, Button, OutlinedButton, FilledTonalButton, Icon, Spacer, Text, } from '@expo/ui/jetpack-compose'; import { width } from '@expo/ui/jetpack-compose/modifiers'; const addIcon = require('./assets/add.png'); const sendIcon = require('./assets/send.png'); export default function ButtonWithIconsExample() { return ( <Host matchContents> {/* Leading icon */} <Button onClick={() => {}}> <Icon source={addIcon} size={18} tintColor="#FFFFFF" /> <Spacer modifiers={[width(8)]} /> <Text>Add Item</Text> </Button> {/* Trailing icon */} <OutlinedButton onClick={() => {}}> <Text>Send</Text> <Spacer modifiers={[width(8)]} /> <Icon source={sendIcon} size={18} /> </OutlinedButton> {/* Both leading and trailing icons */} <FilledTonalButton onClick={() => {}}> <Icon source={addIcon} size={18} /> <Spacer modifiers={[width(8)]} /> <Text>Create & Send</Text> <Spacer modifiers={[width(8)]} /> <Icon source={sendIcon} size={18} /> </FilledTonalButton> </Host> ); }

Custom colors

Override container and content colors using the colors prop.

CustomColorsExample.tsx
import { Host, Button, Text } from '@expo/ui/jetpack-compose'; export default function CustomColorsExample() { return ( <Host matchContents> <Button onClick={() => {}} colors={{ containerColor: '#6200EE', contentColor: '#FFFFFF' }}> <Text>Purple Button</Text> </Button> </Host> ); }

Custom shape

CustomShapeExample.tsx
import { Host, Button, Shape, Text } from '@expo/ui/jetpack-compose'; export default function CustomShapeExample() { return ( <Host matchContents> <Button onClick={() => {}} shape={Shape.RoundedCorner({ cornerRadii: { topStart: 16, bottomEnd: 16 } })}> <Text>Custom Shape</Text> </Button> </Host> ); }

API

import { Button, FilledTonalButton, OutlinedButton, ElevatedButton, TextButton, } from '@expo/ui/jetpack-compose';

Components

Button

Android

Type: React.Element<ButtonProps>

A filled button component.

ButtonProps

children

Android
Type: React.ReactNode

Content to display inside the button.

colors

Android
Optional • Type: ButtonColors

Colors for button elements.

contentPadding

Android
Optional • Type: ButtonContentPadding

The padding between the button container and its content. Use this to adjust internal spacing, for example when adding a leading icon

enabled

Android
Optional • Type: boolean • Default: true

Whether the button is enabled for user interaction.

modifiers

Android
Optional • Type: ModifierConfig[]

Modifiers for the component.

onClick

Android
Optional • Type: () => void

Callback that is called when the button is clicked.

shape

Android
Optional • Type: ShapeJSXElement

The shape of the button.

ElevatedButton

Android

Type: React.Element<ButtonProps>

An elevated button component.

FilledTonalButton

Android

Type: React.Element<ButtonProps>

A filled tonal button component.

OutlinedButton

Android

Type: React.Element<ButtonProps>

An outlined button component.

TextButton

Android

Type: React.Element<ButtonProps>

A text button component.

Types

ButtonColors

Android

Colors for button elements.

PropertyTypeDescription
containerColor(optional)ColorValue
-
contentColor(optional)ColorValue
-
disabledContainerColor(optional)ColorValue
-
disabledContentColor(optional)ColorValue
-

ButtonContentPadding

Android

Content padding for the button's inner content. All values are in density-independent pixels (dp).

PropertyTypeDescription
bottom(optional)number
-
end(optional)number
-
start(optional)number
-
top(optional)number
-