Skip to main content

Stack Navigation

Stack navigation provides a card-based navigation pattern where screens are stacked on top of each other. It’s the most common navigation pattern in mobile apps.

Basic Stack

Create a stack layout:
app/_layout.tsx
All routes in the directory use stack navigation:
From the source (Stack.tsx:1-13):

Screen Configuration

Configure screens in the layout:
app/_layout.tsx

Dynamic Screen Options

Set screen options from within the route:
app/profile.tsx

Header Configuration

Header Styles

Header Buttons

app/edit-profile.tsx

Large Headers (iOS)

Transparent Headers

Presentation Styles

Present screen as modal:
app/_layout.tsx

Full Screen Modal

Form Sheet (iOS)

Transparent Modal

Animations

Custom Transitions

Gesture Configuration

Disable Animations

Search Bar (iOS)

Add native search bar:
app/contacts.tsx

Back Button

Custom Back Button

Hide Back Button

Custom Back Button

Web-Specific Options

From the source (StackClient.tsx:55-93):

Status Bar

Configure Status Bar

Nested Stacks

Create nested stack navigation:
app/(tabs)/profile/_layout.tsx

Common Patterns

app/filter-modal.tsx

Form with Save/Cancel

app/edit-note.tsx

Image Viewer

app/photo/[id].tsx
app/(tabs)/_layout.tsx

Best Practices

Set Titles

Always provide descriptive titles:

Use Consistent Headers

Set default styles in screenOptions:

Handle Back Navigation

Always check if can go back:

Platform-Specific Options

Next Steps

Tab Navigation

Create tab navigation

Drawer Navigation

Add drawer navigation

Layouts

Understand layouts

Navigation

Navigate between stacks