React Navigation
CallstackOfficialPublished by Callstack
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured reference for building navigation interfaces in React applications using React Navigation 7. It covers both the modern Static API and the traditional Dynamic API, offering guidance on implementing stacks, tabs, drawers, and sheets. The documentation includes best practices for configuring headers, handling safe areas, and managing navigation state across different platforms.
What it does
- Provides patterns for implementing stack, tab, and drawer navigation.
- Explains how to configure headers and navigation UI elements.
- Offers guidance on handling safe areas and screen insets.
- Demonstrates how to integrate icons and custom backgrounds into navigation components.
- Supports both Static and Dynamic API styles for navigation configuration.
- Includes techniques for programmatic navigation control and scroll-to-top functionality.
When to use it
- When building navigation structures for React-based mobile or web applications.
- When you need to implement consistent UI patterns like sidebars, bottom tabs, or modals.
- When configuring platform-specific navigation behaviors or safe-area insets.
- When migrating or setting up navigation in a React Navigation 7 environment.
Advantages
- Provides clear API selection guidance for new and existing projects.
- Offers standardized patterns for common navigation UI components.
- Includes practical code examples for both Static and Dynamic APIs.
- Addresses cross-platform layout requirements for web and mobile.
Usage examples
- “How do I create a bottom tab navigator in React Navigation 7?”
- The skill provides code snippets for both Static and Dynamic APIs, showing how to use createBottomTabNavigator and configure tab icons.
- “How can I handle safe areas in my navigation header?”
- The skill directs you to the safe-areas reference, explaining how to manage status bar and header insets for a consistent UI.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/callstackincubator/react-navigation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip react-navigation.zip -d .agents/skills
Documentation by Callstack
React Navigation
Overview
Guide for building navigation UIs with React Navigation.
This skill only applies to React Navigation 7. The API and patterns may not work with different versions.
API Selection
React Navigation offers two API - object-based Static API and component-based Dynamic API.
Existing Apps: Check the current navigation setup and follow the same API style when using the references
New Apps: If the app does not have an existing navigation setup yet, prefer
Static API
When to Apply
Reference this skill when:
Building navigation UI patterns such as stacks, tabs, drawers, sheets etc.
Configuring headers and other built-in navigator UI
Handling safe areas and insets in navigation UI
References
| File | Description |
|---|---|
| stacks.md | Stack based navigation |
| form-sheet.md | Bottom sheet and form sheets |
| bottom-tabs.md | Cross-platform bottom tabs |
| native-bottom-tabs.md | Native bottom tabs |
| material-top-tabs.md | Swipeable Top tabs |
| drawers.md | Drawer navigation and sidebars |
| header.md | Configuring headers |
| safe-areas.md | Safe-area handling |
Problem -> Skill Mapping
| Problem | Start With |
|---|---|
| Showing screens and modals in a stack | stacks.md |
| Showing bottom sheets or form sheets | form-sheet.md |
| Showing screens in bottom tabs or responsive sidebars with web support | bottom-tabs.md |
| Showing screens in native tabs on iOS & Android | native-bottom-tabs.md |
| Showing content in swipeable top tabs | material-top-tabs.md |
| Using a drawer or sidebar | drawers.md |
| Configuring the header in bottom tab or drawer navigator | header.md |
| Handling safe-area such as status bar, header insets, tab bar insets etc. | safe-areas.md |
Files
- ATTRIBUTION.mdAdded by AutoGineer851 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md3.3 KiB
- agents/openai.yaml268 B
- references/bottom-tabs.md12.7 KiB
- references/drawers.md12.0 KiB
- references/form-sheet.md8.0 KiB
- references/header.md6.8 KiB
- references/material-top-tabs.md11.5 KiB
- references/native-bottom-tabs.md8.7 KiB
- references/safe-areas.md3.8 KiB
- references/stacks.md11.7 KiB
references/form-sheet.md
title: Form Sheets with Native Stack impact: MEDIUM tags: react-navigation, native-stack, form-sheet, bottom-sheet, modal, detents
Skill: Form Sheets with Native Stack
Description
Use native-stack presentation: 'formSheet' when a screen should open as a sheet.
When to Use
Presenting secondary flows such as edit forms, filters, pickers, or lightweight detail screens
Keeping the current screen visible underneath a native sheet presentation
Basic Example
Static API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const AppStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
EditProfile: {
screen: EditProfileScreen,
options: {
presentation: 'formSheet',
headerShown: false,
sheetAllowedDetents: 'fitToContents',
},
},
},
});Dynamic API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function AppStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="EditProfile"
component={EditProfileScreen}
options={{
presentation: 'formSheet',
headerShown: false,
sheetAllowedDetents: 'fitToContents',
}}
/>
</Stack.Navigator>
);
}Configuring Sheet Sizes
By default, a form sheet takes the full screen height. Use sheetAllowedDetents to control the heights where the sheet can rest.
Use
'fitToContents'to size the sheet from its content.Use an ascending array of fractions such as
[0.25, 0.5, 1]for fixed detents.On Android, only the first 3 detents are used.
Use
sheetInitialDetentIndexto choose the opening detent, or'last'for the largest one.
Fit to Contents
sheetResizeAnimationEnabled is Android only and controls the default resize animation when using 'fitToContents'.
Static API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const AppStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Filters: {
screen: FiltersScreen,
options: {
presentation: 'formSheet',
sheetAllowedDetents: 'fitToContents',
},
},
},
});Dynamic API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function AppStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="Filters"
component={FiltersScreen}
options={{
presentation: 'formSheet',
sheetAllowedDetents: 'fitToContents',
}}
/>
</Stack.Navigator>
);
}On iOS, a top-level flex: 1 content container works with 'fitToContents'.
On Android, 'fitToContents' does not work with a top-level flex: 1 content container. The sheet can disappear and leave only the dimmed backdrop visible.
Fixed Detents and Initial Detent
sheetShouldOverflowTopInset is Android only and changes whether detent fractions are measured against the full stack height or the inset-adjusted height.
Static API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const AppStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Details: {
screen: DetailsScreen,
options: {
presentation: 'formSheet',
sheetAllowedDetents: [0.25, 0.5, 1],
sheetInitialDetentIndex: 1,
},
},
},
});Dynamic API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function AppStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="Details"
component={DetailsScreen}
options={{
presentation: 'formSheet',
sheetAllowedDetents: [0.25, 0.5, 1],
sheetInitialDetentIndex: 1,
}}
/>
</Stack.Navigator>
);
}On iOS, fixed detents do not automatically make content fill the sheet height. Use contentStyle.backgroundColor if the uncovered area would otherwise look translucent.
Customizing Appearance
sheetGrabberVisibleis iOS only and shows the grabber.sheetCornerRadiusoverrides the default corner radius.sheetElevationis Android only, adjusts the top-edge shadow, and cannot be changed after mount.sheetLargestUndimmedDetentIndexcontrols when the background stays undimmed:'none'always dims,'last'never dims, and a number keeps the background undimmed up to that detent index. On iOS, the system can still add dimming if the sheet grows beyond that height without a detent change, such as when the keyboard appears.contentStyle.backgroundColorsets an explicit background color for the whole sheet. This is especially useful on iOS with fixed detents, where the content does not automatically fill the sheet height.
Static API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const AppStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Composer: {
screen: ComposerScreen,
options: {
presentation: 'formSheet',
sheetAllowedDetents: [0.5, 1],
sheetGrabberVisible: true,
sheetCornerRadius: 24,
sheetElevation: 12,
sheetLargestUndimmedDetentIndex: 0,
contentStyle: {
backgroundColor: '#fff',
},
},
},
},
});Dynamic API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function AppStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="Composer"
component={ComposerScreen}
options={{
presentation: 'formSheet',
sheetAllowedDetents: [0.5, 1],
sheetGrabberVisible: true,
sheetCornerRadius: 24,
sheetElevation: 12,
sheetLargestUndimmedDetentIndex: 0,
contentStyle: {
backgroundColor: '#fff',
},
}}
/>
</Stack.Navigator>
);
}Scroll Behavior
On iOS, scrolling can expand the sheet to a larger detent by default. sheetExpandsWhenScrolledToEdge is iOS only, and setting it to false prevents that behavior.
For this to work, the ScrollView must be reachable by following the first child at each level from the screen component (aka first descendant chain).
Static API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const AppStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Comments: {
screen: CommentsScreen,
options: {
presentation: 'formSheet',
sheetAllowedDetents: [0.5, 1],
sheetExpandsWhenScrolledToEdge: false,
},
},
},
});Dynamic API
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function AppStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="Comments"
component={CommentsScreen}
options={{
presentation: 'formSheet',
sheetAllowedDetents: [0.5, 1],
sheetExpandsWhenScrolledToEdge: false,
}}
/>
</Stack.Navigator>
);
}On Android, nested ScrollView usage may require nestedScrollEnabled, and still does not work when the content is shorter than the scroll view.
Notes
On Android,
presentation: 'formSheet'screens do not currently support nested stack navigators orheaderShown.
Canonical Docs
Related Skills
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Callstack
- Publisher
- Callstack (Official)
- Source
- callstackincubator/agent-skills · skills/react-navigation · commit 59e9d17
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Callstack.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download react-navigation.zip