--- title: Create a modal --- import { SnackInline } from '~/ui/components/Snippet'; import Video from '~/components/plugins/Video'; import { A } from '~/ui/components/Text'; import ImageSpotlight from '~/components/plugins/ImageSpotlight'; import { Step } from '~/ui/components/Step'; import { BoxLink } from '~/ui/components/BoxLink'; import { BookOpen02Icon } from '@expo/styleguide-icons'; React Native provides a [`` component](https://reactnative.dev/docs/modal) that presents content above the rest of your app. In general, modals are used to draw a user's attention toward critical information or guide them to take action. For example, in the [second chapter](/tutorial/build-a-screen/#step-7-enhance-the-reusable-button-component), we used `alert()` to display a placeholder when a button is pressed. That's how a modal component displays an overlay. In this chapter, we'll create a modal that shows an emoji picker list. ## Declare a state variable to show buttons Before implementing the modal, we are going to add three new buttons. These buttons will only be visible when the user picks an image from the media library or decides to use the placeholder image. One of these buttons will trigger the emoji picker modal. Declare a state variable called `showAppOptions` in **App.js**. We'll use this variable to show or hide buttons that open the modal alongside a few other options. This variable is a boolean. When the app screen loads, we'll set it to `false` so that the options are not shown before picking an image. {/* prettier-ignore */} ```jsx App.js export default function App() { /* @info Create a state variable inside the App component. */const [showAppOptions, setShowAppOptions] = useState(false); /* @end */ // ...rest of the code remains same } ``` The value of this variable will be set to `true` when the user picks an image from the media library or decides to use the placeholder image. Next, modify the `pickImageAsync()` function to set the value of `showAppOptions` to `true` after the user picks an image. {/* prettier-ignore */} ```jsx App.js const pickImageAsync = async () => { // ...rest of the code remains same if (!result.canceled) { setSelectedImage(result.assets[0].uri); /* @info After selecting the image, set the App options to true. */ setShowAppOptions(true); /* @end */ } else { // ...rest of the code remains same } }; ``` Then, update the button with no theme by adding an `onPress` prop with the following value: {/* prettier-ignore */} ```jsx App.js