This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Universal
Cross-platform components for building shared UIs across Android, iOS, and web with @expo/ui.
The universal components in @expo/ui are a single-API layer over the platform-native UI toolkits. On Android, they delegate to @expo/ui/jetpack-compose. On iOS, they delegate to @expo/ui/swift-ui. On web, they're JS implementations using react-dom or react-native-web and are picked per component to suit the control.
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
Universal components must still be wrapped in a Host, but you import everything, including Host, from the package root. The universal Host dispatches to the platform-native host on Android and iOS, so there's no need to reach for @expo/ui/swift-ui or @expo/ui/jetpack-compose directly.
import { Host, Column, Button, Text } from '@expo/ui'; export default function Example() { return ( <Host style={{ flex: 1 }}> <Column spacing={12} alignment="center"> <Text>Hello, world!</Text> <Button label="Press me" onPress={() => alert('Pressed')} /> </Column> </Host> ); }
Components
| Component | Description |
|---|---|
BottomSheet | A modal sheet that slides up from the bottom of the screen. |
Button | A pressable button with multiple visual variants. |
Checkbox | A toggle control that represents a checked or unchecked state. |
Collapsible | A labelled tappable header that toggles visibility of its content. |
Column | A vertical layout container for universal @expo/ui components. |
FieldGroup | A scrollable container of grouped settings-style rows. |
Host | A cross-platform Host component that wraps universal @expo/ui content. |
Icon | A platform-native icon — SF Symbol on iOS, Material Symbol on Android. |
List | A virtualized vertical container of rows, paired with a tappable ListItem primitive. |
Picker | A single-selection input with menu and wheel appearances. |
RNHostView | A cross-platform component for hosting React Native views inside @expo/ui views. |
Row | A horizontal layout container for universal @expo/ui components. |
ScrollView | A scrollable container that supports vertical or horizontal scrolling. |
Slider | A control for selecting a value from a continuous or stepped range. |
Spacer | A layout spacer that produces empty space between siblings. |
Switch | A toggle control that switches between on and off states. |
Text | A component for displaying styled text content. |
TextInput | A text input backed by native SwiftUI and Jetpack Compose components, with a React Native-compatible API. |
When to use this versus swift-ui / jetpack-compose
- Reach for universal components when you want one component tree that runs unmodified on Android, iOS, and web. The platform-native look and feel is preserved on Android and iOS because the components delegate to Jetpack Compose/SwiftUI under the hood.
- Reach for
@expo/ui/swift-uior@expo/ui/jetpack-composedirectly when you need platform-specific controls, modifiers, or behavior that the universal API doesn't surface.