Truly native
iOS uses UISheetPresentationController, Android uses Material BottomSheetDialog. React renders only your content.
Bottom sheets, modals, alerts, toasts and popovers with stacking, snap points and full design control. One API on iOS, Android and the browser.
npm install react-native-universal-sheet
cd ios && pod installyarn add react-native-universal-sheet
cd ios && pod installnpx expo install react-native-universal-sheet
npx expo prebuild
npx expo run:ios # or: npx expo run:androidSee Installation for requirements, Expo and web setup.
import {Button} from 'react-native';
import {NativeSheetProvider, useNativeSheet} from 'react-native-universal-sheet';
export default function App() {
return (
<NativeSheetProvider>
<Home />
</NativeSheetProvider>
);
}
function Home() {
const sheet = useNativeSheet();
return (
<Button
title="Open filters"
onPress={() =>
sheet.present({
id: 'filters',
content: <Filters />,
snapPoints: ['50%', '90%'],
})
}
/>
);
}These are placement diagrams. See Sheet types for all 23 and Platform support for what each platform draws today.
Early release (0.1.0)
The TypeScript API and the web renderer are complete and unit-tested. The native iOS and Android code has not yet been verified on a device, and on native every variant is currently presented as a bottom sheet. Read Status & roadmap before using this in production.