This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 55).
Expo Router Stack
An Expo Router API that provides Stack navigator, toolbar, and screen components.
An Expo Router API that provides Stack navigator, toolbar, and screen components.
See the Expo Router reference for installation and configuration.
Usage
import { Stack } from 'expo-router'; export default function Layout() { return <Stack />; }
For more information about using stack navigator, read the stack layout guide:
Learn how to use the Stack layout in Expo Router.
API
import { Stack } from 'expo-router';
Components
Type: React.Element<StackHeaderProps>
The component used to configure header styling for a stack screen.
Use this component to set header appearance properties like blur effect, background color, and shadow visibility.
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Header blurEffect="systemMaterial" style={{ backgroundColor: '#fff' }} /> <ScreenContent /> </> ); }
Example
When used inside a layout with Stack.Screen:
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="index"> <Stack.Header blurEffect="systemMaterial" /> </Stack.Screen> </Stack> ); }
Note: If multiple instances of this component are rendered for the same screen, the last one rendered in the component tree takes precedence.
boolean • Default: falseWhen true, renders children as a custom header component, replacing the default header entirely.
Use this to implement fully custom header layouts.
BlurEffectTypesThe blur effect to apply to the header background on iOS. Common values include 'regular', 'prominent', 'systemMaterial', etc.
ReactNodeChild elements for custom header when asChild is true.
boolean • Default: falseWhether to hide the header completely. When set to true, the header will not be rendered.
StyleProp<{
backgroundColor: ColorValue,
shadowColor: 'transparent'
}>Style properties for the large title header (iOS).
backgroundColor: Background color of the large title headershadowColor: Set to 'transparent' to hide the large title shadow/border
StyleProp<{
backgroundColor: ColorValue,
color: ColorValue,
shadowColor: 'transparent'
}>Style properties for the standard-sized header.
color: Tint color for header elements (similar to tintColor in React Navigation)backgroundColor: Background color of the headershadowColor: Set to 'transparent' to hide the header shadow/border
Type: React.Element<StackScreenProps>
SingularOptionsWhen enabled, the navigator will reuse an existing screen instead of pushing a new one.
Only supported when used inside a Layout component.
Deprecated: Use
dangerouslySingularinstead.Only supported when used inside a Layout component.
(__namedParameters: {
params: Record<string, any>
}) => string | undefinedFunction to determine a unique ID for the screen.
Record<string, any>Initial params to pass to the route.
Only supported when used inside a Layout component.
unionListeners for navigation events.
Only supported when used inside a Layout component.
Acceptable values are: Partial<undefined> | (prop: {
navigation: any,
route: RouteProp<ParamListBase, string>
}) => ScreenListeners<TState, TEventMap>
unionOptions to configure the screen.
Accepts an object or a function returning an object.
The function form options={({ route }) => ({})} is only supported when used inside a Layout component.
When used inside a page component, pass an options object directly.
Acceptable values are: NativeStackNavigationOptions | (prop: {
navigation: any,
route: RouteProp<ParamListBase, string>
}) => NativeStackNavigationOptions
booleanRedirect to the nearest sibling route.
If all children are redirect={true}, the layout will render null as there are no children to render.
Only supported when used inside a Layout component.
Type: React.Element<StackSearchBarProps>
A search bar component that integrates with the native stack header.
Note: Using
Stack.SearchBarwill automatically make the header visible (headerShown: true), as the search bar is rendered as part of the native header.
To display the search bar in the bottom toolbar on iOS 26+, use
Stack.Toolbar.SearchBarSlot inside Stack.Toolbar.
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.SearchBar placeholder="Search..." onChangeText={(text) => console.log(text)} /> <ScreenContent /> </> ); }
Type: React.Element<StackToolbarProps>
The component used to configure the stack toolbar.
- Use
placement="left"to customize the left side of the header. - Use
placement="right"to customize the right side of the header. - Use
placement="bottom"(default) to show a bottom toolbar (iOS only).
If multiple instances of this component are rendered for the same screen, the last one rendered in the component tree takes precedence.
Note: Using
Stack.Toolbarwithplacement="left"orplacement="right"will automatically make the header visible (headerShown: true), as the toolbar is rendered as part of the native header.
Note:
Stack.Toolbarwithplacement="bottom"can only be used inside page components, not in layout components.
Example
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="index"> <Stack.Toolbar placement="left"> <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} /> </Stack.Toolbar> <Stack.Toolbar placement="right"> <Stack.Toolbar.Button icon="ellipsis.circle" onPress={() => alert('Right button pressed!')} /> </Stack.Toolbar> </Stack.Screen> </Stack> ); }
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Toolbar placement="left"> <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} /> </Stack.Toolbar> <Stack.Toolbar> <Stack.Toolbar.Spacer /> <Stack.Toolbar.Button icon="magnifyingglass" onPress={() => {}} /> <Stack.Toolbar.Spacer /> </Stack.Toolbar> <ScreenContent /> </> ); }
boolean • Default: falseWhen true, renders children as a custom component in the header area,
replacing the default header layout.
Only applies to placement="left" and placement="right".
ReactNodeChild elements to compose the toolbar. Can include Stack.Toolbar.Button, Stack.Toolbar.Menu, Stack.Toolbar.View, Stack.Toolbar.Spacer, and Stack.Toolbar.SearchBarSlot (bottom only) components.
Type: React.Element<StackScreenBackButtonProps>
Component to configure the back button.
Can be used inside Stack.Screen in a layout or directly inside a screen component.
Example
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="detail"> <Stack.Screen.BackButton displayMode="minimal">Back</Stack.Screen.BackButton> </Stack.Screen> </Stack> ); }
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Screen.BackButton hidden /> <ScreenContent /> </> ); }
Note: If multiple instances of this component are rendered for the same screen, the last one rendered in the component tree takes precedence.
Type: React.Element<StackScreenTitleProps>
Component to set the screen title.
Can be used inside Stack.Screen in a layout or directly inside a screen component.
Example
String title in a layout:
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="index"> <Stack.Screen.Title large>Home</Stack.Screen.Title> </Stack.Screen> </Stack> ); }
Example
String title inside a screen:
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Screen.Title>My Page</Stack.Screen.Title> <ScreenContent /> </> ); }
Example
Custom component as the title using asChild:
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="index"> <Stack.Screen.Title asChild> <MyCustomTitle /> </Stack.Screen.Title> </Stack.Screen> </Stack> ); }
Note: If multiple instances of this component are rendered for the same screen, the last one rendered in the component tree takes precedence.
booleanUse this to render a custom component as the header title.
Example
<Stack.Screen.Title asChild> <MyCustomTitle /> </Stack.Screen.Title>
React.ReactNodeThe title content. Pass a string for a plain text title,
or a custom component when asChild is enabled.
StyleProp<{
color: string,
fontFamily: TextStyle[fontFamily],
fontSize: TextStyle[fontSize],
fontWeight: Exclude<TextStyle[fontWeight], number>
}>Style properties for the large title header.
StyleProp<{
color: string,
fontFamily: TextStyle[fontFamily],
fontSize: TextStyle[fontSize],
fontWeight: Exclude<TextStyle[fontWeight], number>,
textAlign: 'left' | 'center'
}>Type: React.Element<FC<StackToolbarBadgeProps>>
Type: React.Element<FC<StackToolbarButtonProps>>
ReactNodeThere are two ways to specify the content of the button:
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Toolbar placement="left"> <Stack.Toolbar.Button icon="star.fill">As text passed as children</Stack.Toolbar.Button> </Stack.Toolbar> <ScreenContent /> </> ); }
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Toolbar placement="left"> <Stack.Toolbar.Button> <Stack.Toolbar.Icon sf="star.fill" /> <Stack.Toolbar.Label>As components</Stack.Toolbar.Label> <Stack.Toolbar.Badge>3</Stack.Toolbar.Badge> </Stack.Toolbar.Button> </Stack.Toolbar> <ScreenContent /> </> ); }
Note: When icon is used, the label will not be shown and will be used for accessibility purposes only. Badge is only supported in left/right placements, not in bottom (iOS toolbar limitation).
boolean • Default: falseWhether the button should be hidden.
unionIcon to display in the button.
Can be a string representing an SFSymbol or an image source.
Note: When used in
placement="bottom", only string SFSymbols are supported. Use theimageprop to provide custom images.
Acceptable values are: ImageSourcePropType | SFSymbols7_0
stringControls how image-based icons are rendered on iOS.
'template': iOS applies tint color to the icon'original': Preserves original icon colors (useful for multi-color icons)
Default behavior:
- If
tintColoris specified, defaults to'template' - If no
tintColor, defaults to'original'
This prop only affects image-based icons (not SF Symbols).
See: Apple documentation for more information.
Acceptable values are: 'template' | 'original'
ImageRefImage to display in the button.
Note: This prop is only supported in toolbar with
placement="bottom".
booleanWhether the button is in a selected state
See: Apple documentation for more information
boolean • Default: falseWhether to separate the background of this item from other header items.
ColorValueThe tint color to apply to the button item
See: Apple documentation for more information.
Type: React.Element<FC<StackToolbarIconProps>>
stringControls how the image icon is rendered on iOS.
'template': iOS applies tint color to the icon'original': Preserves original icon colors
Defaults based on parent component's tintColor:
- With
tintColor: defaults to'template' - Without
tintColor: defaults to'original'
Acceptable values are: 'template' | 'original'
ImageSourcePropTypeSFSymbolType: React.Element<FC<StackToolbarLabelProps>>
Type: React.Element<FC<StackToolbarMenuProps>>
ReactNodeMenu content - can include icons, labels, badges and menu actions.
Example
<Stack.Toolbar.Menu> <Stack.Toolbar.Icon sfSymbol="ellipsis.circle" /> <Stack.Toolbar.Label>Options</Stack.Toolbar.Label> <Stack.Toolbar.MenuAction onPress={() => {}}>Action 1</Stack.Toolbar.MenuAction> </Stack.Toolbar.Menu>
booleanIf true, the menu item will be displayed as destructive.
See: Apple documentation for more information.
stringThe preferred size of the menu elements.
Note: This prop is only supported in
Stack.Toolbar.Bottom.
See: Apple documentation for more information.
Acceptable values are: 'small' | 'auto' | 'medium' | 'large'
booleanWhether to hide the shared background.
See: Official Apple documentation for more information.
unionIcon for the menu item.
Can be an SF Symbol name or an image source.
Note: When used in
placement="bottom", only string SFSymbols are supported. Use theimageprop to provide custom images.
Acceptable values are: ImageSourcePropType | SFSymbols7_0
stringControls how image-based icons are rendered on iOS.
'template': iOS applies tint color to the icon (useful for monochrome icons)'original': Preserves original icon colors (useful for multi-color icons)
Default behavior:
- If
tintColoris specified, defaults to'template' - If no
tintColor, defaults to'original'
This prop only affects image-based icons (not SF Symbols).
See: Apple documentation for more information.
Acceptable values are: 'template' | 'original'
ImageRefImage to display for the menu item.
Note: This prop is only supported in toolbar with
placement="bottom".
booleanIf true, the menu will be displayed inline.
This means that the menu will not be collapsed
Note: Inline menus are only supported in submenus.
See: Apple documentation for more information.
booleanIf true, the menu will be displayed as a palette.
This means that the menu will be displayed as one row
Note: Palette menus are only supported in submenus.
See: Apple documentation for more information.
boolean • Default: falseWhether to separate the background of this item from other header items.
StyleProp<BasicTextStyle>Style for the label of the header item.
ColorValueThe tint color to apply to the button item
See: Apple documentation for more information.
Type: React.Element<FC<StackToolbarMenuActionProps>>
booleanIf true, the menu item will be displayed as destructive.
See: Apple documentation for more information.
booleanIf true, the menu item will be disabled and not selectable.
See: Apple documentation for more information.
stringAn elaborated title that explains the purpose of the action.
unionAcceptable values are: ImageSourcePropType | SFSymbols7_0
stringControls how image-based icons are rendered on iOS.
'template': iOS applies tint color to the icon (useful for monochrome icons)'original': Preserves original icon colors (useful for multi-color icons)
Default behavior:
- If
tintColoris specified, defaults to'template' - If no
tintColor, defaults to'original'
This prop only affects image-based icons (not SF Symbols).
See: Apple documentation for more information.
Acceptable values are: 'template' | 'original'
ImageRefImage to display for the menu action.
Note: This prop is only supported in
Stack.Toolbar.Bottom.
stringAn optional subtitle for the menu item.
See: Apple documentation for more information.
booleanIf true, the menu will be kept presented after the action is selected.
This is marked as unstable, because when action is selected it will recreate the menu, which will close all opened submenus and reset the scroll position.
See: Apple documentation for more information.
Type: React.Element<FC<StackToolbarSearchBarSlotProps>>
boolean • Default: falseWhether the search bar slot should be hidden.
booleanWhether this search bar slot has a separate background from adjacent items. When this prop is true, the search bar will always render as integratedButton.
In order to render the search bar with a separate background, ensure that adjacent toolbar items have separateBackground set to true or use Stack.Toolbar.Spacer to create spacing.
Example
<Stack.SearchBar onChangeText={()=>{}} /> <Stack.Toolbar placement="bottom"> <Stack.Toolbar.SearchBarSlot /> <Stack.Toolbar.Spacer /> <Stack.Toolbar.Button icon="square.and.pencil" /> </Stack.Toolbar>
Type: React.Element<FC<StackToolbarSpacerProps>>
boolean • Default: falseWhether the spacer should be hidden.
booleanWhether this spacer shares background with adjacent items.
Only available in bottom placement.
Type: React.Element<FC<StackToolbarViewProps>>
boolean • Default: falseWhen true, renders children as a custom component in the header area,
replacing the default header layout.
Only applies to placement="left" and placement="right".
ReactNodeChild elements to compose the toolbar. Can include Stack.Toolbar.Button, Stack.Toolbar.Menu, Stack.Toolbar.View, Stack.Toolbar.Spacer, and Stack.Toolbar.SearchBarSlot (bottom only) components.
ReactElement<unknown, string | JSXElementConstructor<any>>Can be any React node.
booleanWhether to hide the shared background.
See: Official Apple documentation for more information.
Interfaces
| Property | Type | Description |
|---|---|---|
| accessibilityHint(optional) | string | - |
| accessibilityLabel(optional) | string | - |
| children(optional) | ReactNode | - |
| disabled(optional) | boolean | - |
| hidesSharedBackground(optional) | boolean | - |
| icon(optional) | ImageSourcePropType | SFSymbols7_0 | - |
| iconRenderingMode(optional) | 'template' | 'original' | Only for: iOS Controls how image-based icons are rendered on iOS.
Default behavior:
This prop only affects image-based icons (not SF Symbols).
|
| separateBackground(optional) | boolean | - |
| style(optional) | StyleProp<BasicTextStyle> | - |
| tintColor(optional) | ColorValue | - |
| variant(optional) | 'done' | 'prominent' | 'plain' | Default: 'plain' |