Skip to content

Introduction ​

react-native-universal-sheet gives React Native apps one API for every surface that appears over a screen: bottom sheets, modals, alerts, side drawers, toasts, snackbars, popovers, tooltips and more. On iOS and Android the surface is presented by the platform's own sheet controller. On the web it is an accessible DOM dialog.

Why another sheet library? ​

NeedHow this library handles it
A sheet that feels nativeiOS UISheetPresentationController and Android BottomSheetDialog, not a JavaScript imitation
Sheets on top of sheetsA managed stack: presentation: 'stack' or 'replace', with a configurable depth limit
Open a sheet from anywhereuseNativeSheet().present(...), without placing a component in every screen
Keep the parent screen aliveSheet content is rendered by the provider, so the screen that opened it is never unmounted
Errors that don't crashEvery method returns {ok: true} or {ok: false, reason} instead of throwing
One codebase for app and webThe same config renders on iOS, Android and react-native-web

Which surface do I need? ​

You wantUseVariant
A panel from the bottom that can be dragged between heightsNativeSheet or present()bottomSheet
A list of actions (share, delete, report)present()action, share
A centred dialogNativeModalcenter
A confirmation with buttonspresentAlertalert
A short "Saved" messagepresentToasttoast, snackbar
A menu next to a buttonpresent() with anchorpopover, dropdown, contextMenu
A navigation drawerNativeModalside
A blocking spinnerpresent()loadingOverlay

All 23 are described in Sheet types.

Two ways to use it ​

Declarative: render a component and control it with visible.

tsx
<NativeSheet visible={open} snapPoints={['50%', '90%']} onDismiss={() => setOpen(false)}>
  <ProfileForm />
</NativeSheet>

Imperative: call the manager from any event handler.

tsx
const sheet = useNativeSheet();
sheet.present({id: 'profile', content: <ProfileForm />, snapPoints: ['50%', '90%']});

Both use the same manager and the same options. Mix them freely.

Next steps ​

Released under the MIT License.