Skip to main content

Expo UI: Building with SwiftUI and Jetpack Compose Components

· 4 min read

React Native gives you a shared programming model for iOS and Android. Sometimes, though, a screen needs a control that looks and behaves like the platform's own UI. Expo UI lets you use native SwiftUI on iOS and Jetpack Compose on Android from React components.

With Expo SDK 56, Expo UI's iOS and Android APIs are stable. That makes it a practical option for native-feeling forms, pickers, and controls without writing a custom native bridge for every component.

When Expo UI is useful​

Consider Expo UI for controls where native behavior matters: settings, input fields, date pickers, menus, or sheets. You do not need to rewrite your entire screen. Expo UI can be introduced component by component alongside existing React Native views.

Regular React Native components remain a good default for cross-platform layouts and shared design systems.

Install Expo UI​

In an Expo SDK 56 application:

npx expo install @expo/ui

Expo UI is included in Expo Go for SDK 56, but a development build is still useful when you need other custom native modules. At the SDK 56 launch, compatible Expo Go builds were not available in the Apple App Store or Google Play Store; follow the installation options in the SDK 56 release notes.

A SwiftUI button on iOS​

The Host component creates a container for the SwiftUI view tree. Here is a small iOS example:

components/SaveButton.ios.tsx
import React from 'react';
import { Host, Button } from '@expo/ui/swift-ui';

export function SaveButton() {
return (
<Host style={{ height: 56 }}>
<Button label="Save changes" onPress={() => console.log('Saved')} />
</Host>
);
}

Host defines the boundary between the surrounding React Native interface and the native SwiftUI components. Give it an explicit layout size when appropriate, or use its sizing options for content-driven controls.

A Jetpack Compose button on Android​

The Android API uses a similar idea, but its event prop follows the Jetpack Compose API:

components/SaveButton.android.tsx
import React from 'react';
import { Host, Button } from '@expo/ui/jetpack-compose';

export function SaveButton() {
return (
<Host matchContents>
<Button onClick={() => console.log('Saved')}>Save changes</Button>
</Host>
);
}

Notice that the examples use different imports and props. Platform-specific components expose concepts from their native frameworks rather than pretending every API is identical.

You can import SaveButton from a screen and React Native's platform resolution will select the .ios.tsx or .android.tsx implementation. If you support web, add a .web.tsx or shared fallback.

What about a shared Expo UI component?​

Expo SDK 56 also includes a universal component layer designed to run on iOS, Android, and web from a shared API. The iOS and Android native APIs are stable; web support was still experimental at the SDK 56 release. Check the universal API reference for supported components before relying on parity for a web release.

Practical guidance​

  • Start small: replace one picker or settings control and compare behavior on actual devices.
  • Mind layout boundaries: native hosts need a sensible size in React Native layouts.
  • Check events: props and interaction patterns can differ between SwiftUI, Compose, and universal components.
  • Keep accessibility in the test plan: native controls help, but your screen still needs clear labels and a usable focus order.
  • Review dependency replacements individually: SDK 56 offers drop-in alternatives for several libraries, but confirm prop support and styling differences.

Expo UI is not a requirement for every screen. Its value is giving a React Native team a direct path to native platform controls when those controls improve the user experience.

Further reading​