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§
Source§animation?: ModalAnimation | ModalAnimationConfigUnion
animation?: ModalAnimation | ModalAnimationConfigUnion
Animation configuration for modal appearance. Can be a simple animation type string or a detailed config object.
Source§backdrop?: ModalBackdropConfig | ReactNode
backdrop?: ModalBackdropConfig | ReactNode
Backdrop configuration for the modal. Can be false (no backdrop), a custom renderer function, or a configuration object.
Source§closable?: boolean
closable?: boolean
Whether the modal can be closed by user actions (backdrop press, swipe, hardware back).
§hardware Accelerated?: boolean
hardware Accelerated?: boolean
Controls whether to force hardware acceleration for the underlying window.
Determines whether your modal should go under the system navigationbar.
Source§on Backdrop Press?: false | (() => void)
on Backdrop Press?: false | (() => void)
Callback when the backdrop is pressed. Set to false to prevent backdrop press from closing the modal.
§on Orientation Change?: (event: NativeSyntheticEvent<any>) => void
on Orientation Change?: (event: NativeSyntheticEvent<any>) => void
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.
§status Bar Translucent?: boolean
status Bar Translucent?: boolean
Determines whether your modal should go under the system statusbar.
§supported Orientations?: (
| "portrait"
| "portrait-upside-down"
| "landscape"
| "landscape-left"
| "landscape-right"
)[]
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.
Source§swipe?: false | ModalSwipeConfig
swipe?: false | ModalSwipeConfig
Swipe gesture configuration.
Props for the Modal component.