Reference version

This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

SwiftUI

SwiftUI components for building native iOS interfaces with @expo/ui.

iOS
tvOS
Recommended version:
~0.2.0-beta.9

This library is currently in beta and subject to breaking changes. It is not available in the Expo Go app — use development builds to try it out.

The SwiftUI components in @expo/ui/swift-ui allow you to build fully native iOS interfaces using SwiftUI from React Native.

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

Using a component from @expo/ui/swift-ui requires wrapping it in a Host component. The Host is a container for SwiftUI views.

import { Host, Button } from '@expo/ui/swift-ui'; export function SaveButton() { return ( <Host style={{ flex: 1 }}> <Button variant="default">Save changes</Button> </Host> ); }

For an in-depth explanation of how Host works, see the following resources:

Expo UI guide for Swift UI

Learn about the basics of @expo/ui/swift-ui

Expo UI iOS Liquid Glass Tutorial
Expo UI iOS Liquid Glass Tutorial

Learn how to build real SwiftUI views in your React Native app with the new Expo UI.

Components

BottomSheet

Button

The borderless variant is not available on Apple TV.

CircularProgress

ColorPicker

This component is not available on Apple TV.

ContextMenu

Note: Also known as DropdownMenu.

DateTimePicker (date)

This component is not available on Apple TV.

DateTimePicker (time)

This component is not available on Apple TV.

Gauge

This component is not available on Apple TV.

Host

A component that allows you to put the other @expo/ui/swift-ui components in React Native. It acts like <svg> for DOM, <Canvas> for react-native-skia, which internally uses UIHostingController to render the SwiftUI views in UIKit.

Since the Host component is a React Native View, you can pass the style prop to it or matchContents prop to make the Host component match the contents' size.

Wrapping Button in Host
import { Button, Host } from '@expo/ui/swift-ui'; function Example() { return ( <Host matchContents> <Button onPress={() => { console.log('Pressed'); }}> Click </Button> </Host> ); }
Host with flexbox and VStack
import { Button, Host, VStack, Text } from '@expo/ui/swift-ui'; function Example() { return ( <Host style={{ flex: 1 }}> <VStack spacing={8}> <Text>Hello, world!</Text> <Button onPress={() => { console.log('Pressed'); }}> Click </Button> </VStack> </Host> ); }

LinearProgress

List

Picker (segmented)

Picker (wheel)

The wheel variant is not available on Apple TV.

Slider

This component is not available on Apple TV.

Switch (toggle)

Note: Also known as Toggle.

Switch (checkbox)

TextField

More

Expo UI is still in active development. We continue to add more functionality and may change the API. Some examples in the docs may not be up to date. If you want to see the latest changes, check the examples.

API

Full documentation is not yet available. Use TypeScript types to explore the API.

// Import from the SwiftUI package import { BottomSheet } from '@expo/ui/swift-ui';