Here's a single-file example that brings together as many Expo UI components from SDK 53 as possible, using the new native primitives for both iOS (SwiftUI) and Android (Jetpack Compose):
import React, { useState } from 'react';
import { Platform, View, Text } from 'react-native';
import {
Button,
BottomSheet,
ColorPicker,
DateTimePicker,
Gauge,
LinearProgress,
Picker,
Switch,
TextInput,
} from '@expo/ui/swift-ui'; // For iOS
import {
Button as JCButton,
TextInput as JCTextInput,
} from '@expo/ui/jetpack-compose'; // For Android
export default function ExpoUIAllComponents() {
// Shared state hooks
const [isOpen, setIsOpen] = useState(false);
const [color, setColor] = useState('
#ff0000');
const [selectedDate, setSelectedDate] = useState(new Date());
const [selectedIndex, setSelectedIndex] = useState(0);
const [checked, setChecked] = useState(false);
const [inputValue, setInputValue] = useState('');
// iOS/Android platform-specific rendering
if (Platform.OS 'ios') {
return (
<View style={{ padding: 24 }}>
<Button onPress={() => setIsOpen(true)}>Open Bottom Sheet</Button>
<BottomSheet isOpen={isOpen} onIsOpenedChange={setIsOpen}>
<Text>Hello, world!</Text>
</BottomSheet>
<ColorPicker
label="Select a color"
selection={color}
onValueChanged={setColor}
style={{ width: 300, height: 150 }}
/>
<DateTimePicker
onDateSelected={setSelectedDate}
displayedComponents="date"
initialDate={selectedDate.toISOString()}
variant="wheel"
/>
<Gauge
max={{ value: 1, label: '1' }}
min={{ value: 0, label: '0' }}
current={{ value: 0.5 }}
color={['red', 'orange', 'yellow', 'green']}
type="circular"
/>
<LinearProgress progress={0.5} style={{ width: 200 }} />
<Picker
options={['$', '', '$', '']}
selectedIndex={selectedIndex}
onOptionSelected={({ nativeEvent: { index } }) => setSelectedIndex(index)}
/>
<Switch
checked={checked}
onValueChange={setChecked}
label="Play music"
/>
<TextInput
autocorrection={false}
defaultValue="A single line text input"
onChangeText={setInputValue}
/>
</View>
);
} else {
// Android Jetpack Compose components
return (
<View style={{ padding: 24 }}>
<JCButton onPress={() => setIsOpen(true)}>Open Bottom Sheet (Android)</JCButton>
<JCTextInput
autocorrection={false}
defaultValue="A single line text input"
onChangeText={setInputValue}
/>
{/* Add more Jetpack Compose components as they become available */}
</View>
);
}
}
This example uses as many Expo UI components as are currently available, including Button, BottomSheet, ColorPicker, DateTimePicker, Gauge, LinearProgress, Picker, Switch, and TextInput for iOS, and Button and TextInput for Android (more Jetpack Compose components will be added as Expo UI evolves).
You can copy-paste this into your Expo SDK 53 project and see all the new native UI elements in action-just make sure to install @expo/ui and use the correct imports for your platform!