This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
A SwiftUI Button component for displaying native buttons.
A button component for displaying native buttons.
Installation
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
import { Button, Host } from '@expo/ui/swift-ui'; <Host style={{ flex: 1 }}> <Button variant="default" onPress={() => { setEditingProfile(true); }}> Edit profile </Button> </Host>
See official SwiftUI documentation for more information.
API
Component
Type: React.Element<ButtonProps>
Displays a native button component.
unionThe text or React node to display inside the button.
Acceptable values are: string | React.ReactNode
SFSymbolA string describing the system image to display in the button.
This is only used if children is a string.
Uses SF Symbols.
Types
Literal Type: string
Sets the size for controls within this view.
mini- A control version that is minimally sized.small- A control version that is proportionally smaller size for space-constrained views.regular- A control version that is the default size.large- A control version that is prominently sized.extraLarge- A control version that is substantially sized. The largest control size. Resolves to ControlSize.large on platforms other than visionOS.
Acceptable values are: 'mini' | 'small' | 'regular' | 'large' | 'extraLarge'
Literal Type: string
The role of the button.
default- The default button role.cancel- A button that cancels the current operation.destructive- A button that deletes data or performs a destructive action.
Acceptable values are: 'default' | 'cancel' | 'destructive'
Literal Type: string
The built-in button styles available on iOS.
Common styles:
default- The default system button style.bordered- A button with a light fill.borderless- A button with no background or borderborderedProminent- A bordered button with a prominent appearance.plain- A button with no border or background and a less prominent text.glass– A liquid glass button effect (available only from iOS 26, when built with Xcode 26).glassProminent– A liquid glass button effect – (available only from iOS 26, when built with Xcode 26) macOS-only styles:accessoryBar- A button style for accessory bars.accessoryBarAction- A button style for accessory bar actions.card- A button style for cards.link- A button style for links.
Theborderlessvariant is unavailable on Apple TV.
Acceptable values are: 'default' | 'bordered' | 'plain' | 'glass' | 'glassProminent' | 'borderedProminent' | 'borderless' | 'accessoryBar' | 'accessoryBarAction' | 'card' | 'link'