Example
Props
Determines whether your modal is visible.
Called when the user taps the hardware back button on Android, dismisses the sheet using a gesture on iOS (when
allowSwipeDismissal is set to true), or the menu button on Apple TV.Required on iOS and Android.Controls how the modal animates:
'slide'- Slides in from the bottom'fade'- Fades into view'none'- Appears without an animation
Determines whether your modal will fill the entire view. Setting this to
true will render the modal over a transparent background.Callback that is called once the modal has been shown.
Sets the background color of the modal’s container. Defaults to
white if not provided and transparent is false. Ignored if transparent is true.iOS-Specific Props
Determines the style of modal to show.Platform: iOS
supportedOrientations
Array<'portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right'>
Allowed orientations for the modal. On iOS, the modal is still restricted by what’s specified in your app’s Info.plist’s UISupportedInterfaceOrientations field.Platform: iOS
Callback that is called once the modal has been dismissed.Platform: iOS
Called when the orientation changes while the modal is being displayed. The orientation provided is only ‘portrait’ or ‘landscape’.Platform: iOS
Controls whether the modal can be dismissed by swiping down on iOS. This requires you to implement the
onRequestClose prop to handle the dismissal.Platform: iOSAndroid-Specific Props
Controls whether to force hardware acceleration for the underlying window.Platform: Android
Determines whether your modal should go under the system status bar.Platform: Android
Determines whether your modal should go under the system navigation bar.Platform: Android
Presentation Styles (iOS)
fullScreen
The modal covers the entire screen. This is the default whentransparent is false.
pageSheet
The modal covers the screen width but allows the previous view to be partially visible underneath (iPad only).formSheet
The modal is displayed as a centered form that is smaller than the screen (iPad only).overFullScreen
The modal covers the entire screen, but the underlying view is not removed. This is the default whentransparent is true.
Important Notes
- Internal state is not preserved when the modal is closed
- The
onRequestClosecallback is required on Android and iOS - Modals can be nested, with the most recently mounted modal appearing on top
- When using
transparent={true}, you’re responsible for providing a background view - On iOS,
onDismissis called when the modal is dismissed through system gestures
Accessibility
Modal inherits all accessibility props from View. Make sure to:- Set
accessibilityViewIsModal={true}to prevent interaction with views behind the modal - Provide appropriate
accessibilityLabelfor screen readers - Handle focus management when the modal opens and closes