|
| 1 | +--- |
| 2 | +name: react-navigation-ui |
| 3 | +description: Provides React Navigation UI patterns for stacks, tabs, drawers etc. Use when building navigation UIs with React Navigation, configuring headers, bottom sheets or handling safe areas and insets. |
| 4 | +license: MIT |
| 5 | +metadata: |
| 6 | + author: Callstack |
| 7 | + tags: react-navigation, navigation, ui, native-stack, header, bottom-tabs, native-bottom-tabs, material-top-tabs, drawer, form-sheet, status-bar, safe-area, nested-navigators |
| 8 | +--- |
| 9 | + |
| 10 | +# React Navigation UI |
| 11 | + |
| 12 | +## Overview |
| 13 | + |
| 14 | +Guide for building navigation UIs with React Navigation. |
| 15 | + |
| 16 | +This skill only applies to React Navigation 7. The API and patterns may not work with different versions. |
| 17 | + |
| 18 | +## API Selection |
| 19 | + |
| 20 | +React Navigation offers two API - object-based `Static API` and component-based `Dynamic API`. |
| 21 | + |
| 22 | +- **Existing Apps**: Check the current navigation setup and follow the same API style when using the references |
| 23 | +- **New Apps**: If the app does not have an existing navigation setup yet, prefer `Static API` |
| 24 | + |
| 25 | +## When to Apply |
| 26 | + |
| 27 | +Reference this skill when: |
| 28 | + |
| 29 | +- Building navigation UI patterns such as stacks, tabs, drawers, sheets etc. |
| 30 | +- Configuring headers and other built-in navigator UI |
| 31 | +- Handling safe areas and insets in navigation UI |
| 32 | + |
| 33 | +## References |
| 34 | + |
| 35 | +| File | Description | |
| 36 | +| ------------------------------------------- | ------------------------------ | |
| 37 | +| [stacks.md][stacks] | Stack based navigation | |
| 38 | +| [form-sheet.md][form-sheet] | Bottom sheet and form sheets | |
| 39 | +| [bottom-tabs.md][bottom-tabs] | Cross-platform bottom tabs | |
| 40 | +| [native-bottom-tabs.md][native-bottom-tabs] | Native bottom tabs | |
| 41 | +| [material-top-tabs.md][material-top-tabs] | Swipeable Top tabs | |
| 42 | +| [drawers.md][drawers] | Drawer navigation and sidebars | |
| 43 | +| [header.md][header] | Configuring headers | |
| 44 | +| [safe-areas.md][safe-areas] | Safe-area handling | |
| 45 | + |
| 46 | +## Problem -> Skill Mapping |
| 47 | + |
| 48 | +| Problem | Start With | |
| 49 | +| ------------------------------------------------------------------------- | ------------------------------------------- | |
| 50 | +| Showing screens and modals in a stack | [stacks.md][stacks] | |
| 51 | +| Showing bottom sheets or form sheets | [form-sheet.md][form-sheet] | |
| 52 | +| Showing screens in bottom tabs or responsive sidebars with web support | [bottom-tabs.md][bottom-tabs] | |
| 53 | +| Showing screens in native tabs on iOS & Android | [native-bottom-tabs.md][native-bottom-tabs] | |
| 54 | +| Showing content in swipeable top tabs | [material-top-tabs.md][material-top-tabs] | |
| 55 | +| Using a drawer or sidebar | [drawers.md][drawers] | |
| 56 | +| Configuring the header in bottom tab or drawer navigator | [header.md][header] | |
| 57 | +| Handling safe-area such as status bar, header insets, tab bar insets etc. | [safe-areas.md][safe-areas] | |
| 58 | + |
| 59 | +[stacks]: references/stacks.md |
| 60 | +[form-sheet]: references/form-sheet.md |
| 61 | +[safe-areas]: references/safe-areas.md |
| 62 | +[bottom-tabs]: references/bottom-tabs.md |
| 63 | +[native-bottom-tabs]: references/native-bottom-tabs.md |
| 64 | +[material-top-tabs]: references/material-top-tabs.md |
| 65 | +[drawers]: references/drawers.md |
| 66 | +[header]: references/header.md |
0 commit comments