Mobile · Junior

Navigation in apps: stack, tabs and deep links

Navigating in an app is more than switching screens: it is managing a history of where the user has been, making sure the back button does what's expected, and letting a URL open straight onto a specific screen. These patterns — stack, tabs, modals and deep links — are universal across iOS, Android, React Native and Flutter, and understanding how they fit together prevents the most common navigation bugs.

The navigation stack (push/pop)

The metaphor is a stack of plates. Each new screen you open is a plate placed on top (push); going back is removing the top plate (pop), revealing the previous one. The visible screen is always the top of the stack.

top -> [ Product detail ]   (push)
        [ Product list ]
        [ Home ]            <- base

// user presses "back":
top -> [ Product list ]     (pop)
        [ Home ]

The back button (and why Android is different)

On iOS, "back" lives inside the screen itself (top-left corner). On Android there is a system back button/gesture, outside your visual control, and users press it all the time. You need to make sure it pops the stack coherently — and handle the case of being at the root (where going back may close the app). Ignoring this produces the classic bug of "back closes the app in the middle of a flow" or "back doesn't dismiss the modal".

Tabs (tab bar)

Tabs split the app into parallel sections — each tab usually has its own independent stack. Switching tabs doesn't erase the previous one's history: when the user returns, they find the screen they were on. Think of several stacks of plates side by side, with the tab bar choosing which one is active.

Modal navigation

A modal interrupts the flow for a one-off task — login, a form, a confirmation — usually sliding up from the bottom. Unlike push (which moves forward within the same flow), a modal overlays the screen and is dismissed, not "popped". Mixing the two concepts is a common mistake.

PatternWhen to useExit with
Push (stack)Drilling deeper in the same flow (list → detail)Back / pop
TabsParallel sections of the appSwitch tabs
ModalOne-off task that interruptsClose / dismiss

Deep links and universal/app links

A deep link is a URL that opens a specific screen instead of home — for example, tapping meuapp://produto/42 and landing directly on product 42. Universal links (Apple) and app links (Android) go further: they use a normal https URL from your website that, if the app is installed, opens the app on the right screen; otherwise, it opens the browser. This requires verifying domain ownership (an association file on the server).

https://loja.com/produto/42
   |
   +-- app installed? --> opens app on product 42 screen
   |
   +-- otherwise -------> opens in the browser

Interviewers often ask you to describe what happens from tapping a link to the screen opening, including the "app not installed" case. Day to day, this shows up in marketing campaigns, notifications and sharing.

State and navigation go together

When a deep link opens a screen in the middle of a flow, you need to build a coherent stack underneath (so back works) and consider that the app may have been started from scratch — exactly the scenarios from the app lifecycle. Restoring navigation after the app was killed by the OS is a case that ties both topics together.

Navigation is history management, not just screen management. If you always know what the current stack is and what "back" should do, most navigation bugs disappear.

Conclusion

Stacks (push/pop), tabs with parallel histories, modals that overlay and deep links that come in through a URL make up the navigation vocabulary you use on any platform. Mastering the back button's behavior and the flow of universal links separates those who deliver screens from those who deliver consistent experiences.

Read also

Back to the track