Expand description
interface ModalProps {
animation?: ModalAnimation | ModalAnimationConfigUnion;
backdrop?: ModalBackdropConfig | ReactNode;
backdropTestID?: string;
children: ReactNode;
closable?: boolean;
containerTestID?: string;
contentContainerStyle?: StyleProp<ViewStyle>;
contentTestID?: string;
coverScreen?: boolean;
hardwareAccelerated?: boolean;
navigationBarTranslucent?: boolean;
onBackdropPress?: false | (() => void);
onHide?: () => void;
onOrientationChange?: (event: NativeSyntheticEvent<any>) => void;
onShow?: () => void;
statusBarTranslucent?: boolean;
style?: StyleProp<ViewStyle>;
supportedOrientations?: (
| "portrait"
| "portrait-upside-down"
| "landscape"
| "landscape-left"
| "landscape-right"
)[];
swipe?: false
| ModalSwipeConfig;
visible: boolean;
}Properties§
animation?: ModalAnimation | ModalAnimationConfigUnionAnimation configuration for modal appearance. Can be a simple animation type string or a detailed config object.
backdrop?: ModalBackdropConfig | ReactNodeBackdrop configuration for the modal. Can be false (no backdrop), a custom renderer function, or a configuration object.
backdrop Test ID?: stringtestID for the backdrop Pressable.
children: ReactNodeContent to render inside the modal.
closable?: booleanWhether the modal can be closed by user actions (backdrop press, swipe, hardware back).
container Test ID?: stringtestID for the root container View.
content Container Style?: StyleProp<ViewStyle>Style for the content wrapper (Animated.View).
content Test ID?: stringtestID for the modal content (Animated.View).
cover Screen?: booleanIf true, covers the entire screen without using native Modal.
hardware Accelerated?: booleanControls whether to force hardware acceleration for the underlying window.
Determines whether your modal should go under the system navigationbar.
on Backdrop Press?: false | (() => void)Callback when the backdrop is pressed. Set to false to prevent backdrop press from closing the modal.
on Hide?: { ... }Called when the modal disappears.
on Orientation Change?: { ... }The onOrientationChange callback is called when the orientation changes while the modal is being displayed.
The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.
on Show?: { ... }Called when the modal appears.
status Bar Translucent?: booleanDetermines whether your modal should go under the system statusbar.
style?: StyleProp<ViewStyle>Style for the modal container (outer View).
supported Orientations?: (
| "portrait"
| "portrait-upside-down"
| "landscape"
| "landscape-left"
| "landscape-right"
)[]The supportedOrientations prop allows the modal to be rotated to any of the specified orientations.
On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.
swipe?: false | ModalSwipeConfigSwipe gesture configuration.
visible: booleanControls the visibility of the modal.
Props for the Modal component.