# Stack Navigator

## Overview

In mobile app development, a stack navigator is a navigation pattern that allows users to navigate between different screens in a linear manner.

<div align="left"><figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FXjepfEmpbBZY7IC6F1W9%2FStack%20Nav%20-%20screen%20progression%20-%20LP.png?alt=media&#x26;token=3441f012-820a-4447-af2e-ddd35644038c" alt="" width="375"><figcaption></figcaption></figure></div>

It is commonly used for navigation flows with hierarchy, where the user moves forward and backward through a series of screens. When a new screen is opened, it becomes the topmost screen in the stack, and the user sees it displayed on their device. The previously visible screens remain in the stack but are temporarily hidden. When the user navigates back, the topmost screen is popped off the stack, revealing the previous screen. For example, in an account creation flow, the stack navigator would handle the progression from creating an account, completing a user profile, and uploading a profile image.

<div align="left"><figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Fn4TZcPtJE1JhLdbAk9aj%2FStack%20Nav%20-%20screen%20progression%20-%20LP%20(3).png?alt=media&#x26;token=c9557e35-9e5a-478a-8686-2d0c03179428" alt="" width="375"><figcaption></figcaption></figure></div>

## Video Tutorial

### How to Use the Thunkable Stack Navigator

In this tutorial, we'll explore what a stack navigator is and provide step-by-step instructions on implementation.

{% embed url="<https://youtu.be/bN9W7kxe1Fw>" %}

## Add a Navigator

To add a navigator to your app:

1. Click the dropdown arrow at the top of your component tree.
2. Hover over **Add Navigator**.
3. Select the navigator you want to add.

<figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FDk4DJovs5kZuVNMuHYHH%2FNavigator%20menu.png?alt=media&#x26;token=f260a69a-6bff-4260-8b6d-ba343419ca5d" alt=""><figcaption></figcaption></figure>

## Add Screens to a Stack Navigator

To add an additional screen to your stack navigator, create a new screen and, within the component tree, drag it to nest within the stack navigator component. To remove a screen, delete it in the component tree.

## Set Your Screen Transitions

For users to proceed further into the stack, you must add a screen navigation block like the one below to each screen within your stack navigator.&#x20;

<div align="left"><figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Ft9SJp4AtQVAGIvWm3phI%2Fstack%20navigator%20-%20navigate%20to%20screen%20blocks.png?alt=media&#x26;token=120f22cc-f6e3-42fc-a5bc-643c67ac4424" alt="" width="373"><figcaption></figcaption></figure></div>

The navigate to block can be found under the Core blocks heading in the Control drawer of blocks.

<div align="left"><figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F5K4n9kbcs1nInw4GSjDm%2FControl%20%3E%20navigate%20to%20block.png?alt=media&#x26;token=44deba78-6113-4ab1-a116-65222bb3552d" alt="" width="563"><figcaption></figcaption></figure></div>

## Stack Navigator Properties

Click on the stack navigator in the component tree to access the navigator’s properties panel. Here, on the right side, you can customize the properties specific to the navigator.

<table><thead><tr><th width="214.33333333333331">Property</th><th width="198">Value</th><th>Description</th></tr></thead><tbody><tr><td>Presentation</td><td>card or modal</td><td><p>Define how your screens stack:</p><ul><li>card - new screens slide in from the left</li><li>modal - new screens slide in from the bottom</li></ul></td></tr><tr><td>HeaderMode</td><td>float or screen</td><td><p>Define how the header behaves:</p><ul><li>float - headers fade in with the screen change</li><li>screen - headers slide with the screen change</li></ul></td></tr><tr><td>HeaderShown</td><td>True/False</td><td>Define whether or not the header is displayed. When set to false, the header is hidden, including the back arrow typically used to navigate back in the stack navigator.</td></tr><tr><td>Animation</td><td>default, fade, or none</td><td><p>Define how the animation loads when screens are pushed or popped: <br></p><ul><li>default - Default animation based on the platform and OS version.</li><li>fade - Simple fade animation for dialogs.</li><li>none - The screens are pushed or popped immediately without any animation.</li></ul></td></tr></tbody></table>
