Modal

React Native 6 min min read Updated: Jul 26, 2026 Intermediate
Modal
Intermediate Topic 13 of 30

Modal

The Modal component allows developers to display content above the rest of the app, commonly used for popups, alerts, confirmation dialogs, and bottom sheets.

Basic Usage

javascript import { useState } from 'react'; import { Modal, View, Text, Button } from 'react-native'; function App() { const [visible, setVisible] = useState(false); return (

Animation Types

The animationType prop controls how the modal appears, with options including none, slide, and fade, allowing you to match the transition style to your app’s design.

Transparent Background

Setting transparent to true allows the background behind the modal content to remain visible, often combined with a semi-transparent overlay to dim the underlying screen.

javascript Confirm Action

Handling the Android Back Button

The onRequestClose prop is required on Android and defines what happens when the user presses the hardware back button while the modal is open.

Common Use Cases

  • Confirmation and alert dialogs
  • Bottom sheet style menus
  • Image preview overlays
  • Custom login or signup popups

Conclusion

The Modal component provides a flexible way to display overlay content in React Native. Understanding animation types, transparency, and Android back button handling ensures a smooth and polished modal experience.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators