Reference version

Expo Router

A file-based routing library for React Native and web applications.

Android
iOS
tvOS
Web
Included in Expo Go
Bundled version:
~55.0.0-beta.0

expo-router is a routing library for React Native and web apps. It enables navigation management using a file-based routing system and provides native navigation components and is built on top of React Navigation.

Expo Router guides

Learn about Expo Router basics, navigation patterns, core concepts, and more.

Installation

To use Expo Router in your project, you need to install. Follow the instructions from the Expo Router's installation guide:

Install Expo Router

Learn how to install Expo Router in your project.

Configuration in app config

If you are using the default template to create a new project, expo-router's config plugin is already configured in your app config.

Example app.json with config plugin

app.json
{ "expo": { "plugins": ["expo-router"] } }

Configurable properties

NameDefaultDescription
root"app"

Changes the routes directory from app to another value. Avoid using this property unless you have a specific need.

originundefined

Production origin URL where assets in the public folder are hosted. The fetch function is polyfilled to support relative requests from this origin in production. The development origin is inferred using the Expo CLI development server.

headOriginundefined

A more specific origin URL used in the expo-router/head module for iOS handoff. Defaults to origin.

asyncRoutesundefined

Enable async routes (lazy loading). Can be a boolean, a string ("development" or "production"), or an object with platform-specific values ({ android, ios, web, default }). production is currently web-only and will be disabled on native.

platformRoutestrue

Enable or disable platform-specific routes (for example, index.android.tsx and index.ios.tsx).

sitemaptrue

Enable or disable the automatically generated sitemap at /_sitemap.

partialRouteTypestrue

Enable partial typed routes generation. This allows TypeScript to provide type checking for routes without requiring all routes to be statically known.

redirectsundefined

An array of static redirect rules. Each rule should have source, destination, and optionally permanent (defaults to false) and methods (HTTP methods to redirect).

rewritesundefined

An array of static rewrite rules. Each rule should have source, destination, and optionally methods (HTTP methods to rewrite).

headersundefined

A list of headers that are set on every route response from the server. The value can be a string or an array of strings.

disableSynchronousScreensUpdatesfalse

Disable synchronous layout updates for native screens. This can help with performance in some cases.

unstable_useServerMiddlewarefalse
Experimental
 • 

Enable server middleware support with a +middleware.ts file. Requires web.output: "server" to be set in app config.

unstable_useServerDataLoadersfalse
Experimental
 • 

Enable data loader support. This is only supported for web.output: "static" outputs at the moment.

unstable_useServerRenderingfalse
Experimental
 • 

Enable server-side rendering. When enabled with web.output: "server", HTML is rendered at request time instead of being pre-rendered at build time.

Usage

For information core concepts, notation patterns, navigation layouts, and common navigation patterns, start with Router 101 section:

Router 101

API

import { Stack, Tabs, Link } from 'expo-router';

Components

Android
iOS
tvOS
Web

Type: React.Element<LinkProps>

Component that renders a link using href to another route. By default, it accepts children and wraps them in a <Text> component.

Uses an anchor tag (<a>) on web and performs a client-side navigation to preserve the state of the website and navigate faster. The web-only attributes such as target, rel, and download are supported and passed to the anchor tag on web. See WebAnchorProps for more details.

Note: Client-side navigation works with both single-page apps, and static-rendering.

Example

import { Link } from 'expo-router'; import { View } from 'react-native'; export default function Route() { return ( <View> <Link href="/about">About</Link> </View> ); }

LinkProps

asChild

Android
iOS
tvOS
Web
Optional • Type: boolean

Used to customize the Link component. It will forward all props to the first child of the Link. Note that the child component must accept onPress or onClick props. The href and role are also passed to the child.

Example

import { Link } from 'expo-router'; import { Pressable, Text } from 'react-native'; export default function Route() { return ( <View> <Link href="/home" asChild> <Pressable> <Text>Home</Text> </Pressable> </Link> </View> ); }

className

Android
iOS
tvOS
Web
Optional • Type: string

On native, this can be used with CSS interop tools like Nativewind. On web, this sets the HTML class directly.

dangerouslySingular

Android
iOS
tvOS
Web
Optional • Type: SingularOptions

When navigating in a Stack, if the target is valid then screens in the history that matches the uniqueness constraint will be removed.

If used with push, the history will be filtered even if no navigation occurs.

dismissTo

Android
iOS
tvOS
Web
Optional • Type: boolean

While in a stack, this will dismiss screens until the provided href is reached. If the href is not found, it will instead replace the current screen with the provided href.

Example

import { Link } from 'expo-router'; import { View } from 'react-native'; export default function Route() { return ( <View> <Link dismissTo href="/feed">Close modal</Link> </View> ); }

href

Android
iOS
tvOS
Web
Literal type: union

The path of the route to navigate to. It can either be:

  • string: A full path like /profile/settings or a relative path like ../settings.
  • object: An object with a pathname and optional params. The pathname can be a full path like /profile/settings or a relative path like ../settings. The params can be an object of key-value pairs.

Example

Dynamic
import { Link } from 'expo-router'; import { View } from 'react-native'; export default function Route() { return ( <View> <Link href="/about">About</Link> <Link href={{ pathname: '/user/[id]', params: { id: 'bacon' } }}> View user </Link> </View> ); }

Acceptable values are: string | HrefObject

onPress

Android
iOS
tvOS
Web
Optional • Type: (event: MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void

This function is called on press. Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).

prefetch

Android
iOS
tvOS
Web
Optional • Type: boolean

Prefetches the route when the component is rendered on a focused screen.

push

Android
iOS
tvOS
Web
Optional • Type: boolean

Always pushes a new route, and never pops or replaces to existing route. You can push the current route multiple times or with new parameters.

Example

import { Link } from 'expo-router'; import { View } from 'react-native'; export default function Route() { return ( <View> <Link push href="/feed">Login</Link> </View> ); }

ref

Android
iOS
tvOS
Web
Optional • Type: Ref<Text>

relativeToDirectory

Android
iOS
tvOS
Web
Optional • Type: boolean

Relative URL references are either relative to the directory or the document. By default, relative paths are relative to the document.

replace

Android
iOS
tvOS
Web
Optional • Type: boolean

Removes the current route from the history and replace it with the specified URL. This is useful for redirects.

Example

import { Link } from 'expo-router'; import { View } from 'react-native'; export default function Route() { return ( <View> <Link replace href="/feed">Login</Link> </View> ); }

withAnchor

Android
iOS
tvOS
Web
Optional • Type: boolean

Replaces the initial screen with the current route.

Inherited Props

Stack

Android
iOS
tvOS
Web

Renders a native stack navigator.

Tabs

Android
iOS
tvOS
Web

Renders a tabs navigator.

Badge

Android
iOS
tvOS
Web

Type: React.Element<BadgeProps>

BadgeProps

ErrorBoundary

Android
iOS
tvOS
Web

Type: React.Element<ErrorBoundaryProps>

Props passed to a page's ErrorBoundary export.

ErrorBoundaryProps

error

Android
iOS
tvOS
Web
Type: Error

The error that was thrown.

retry

Android
iOS
tvOS
Web
Type: () => Promise<void>

A function that will re-render the route component by clearing the error state.

Icon

Android
iOS
tvOS
Web

Type: React.Element<IconProps>

IconProps

Label

Android
iOS
tvOS
Web

Type: React.Element<LabelProps>

LabelProps

Redirect

Android
iOS
tvOS
Web

Type: React.Element<RedirectProps>

Redirects to the href as soon as the component is mounted.

Example

import { View, Text } from 'react-native'; import { Redirect } from 'expo-router'; export default function Page() { const { user } = useAuth(); if (!user) { return <Redirect href="/login" />; } return ( <View> <Text>Welcome Back!</Text> </View> ); }

RedirectProps

href

Android
iOS
tvOS
Web
Type: Href

The path of the route to navigate to. It can either be:

  • string: A full path like /profile/settings or a relative path like ../settings.
  • object: An object with a pathname and optional params. The pathname can be a full path like /profile/settings or a relative path like ../settings. The params can be an object of key-value pairs.

Example

Dynamic
import { Redirect } from 'expo-router'; export default function RedirectToAbout() { return ( <Redirect href="/about" /> ); }

relativeToDirectory

Android
iOS
tvOS
Web
Optional • Type: boolean

Relative URL references are either relative to the directory or the document. By default, relative paths are relative to the document.

withAnchor

Android
iOS
tvOS
Web
Optional • Type: boolean

Replaces the initial screen with the current route.

Slot

Android
iOS
tvOS
Web

Type: React.Element<Omit<NavigatorProps<any>, 'children'>>

Renders the currently selected content.

There are actually two different implementations of <Slot/>:

  • Used inside a _layout as the Navigator
  • Used inside a Navigator as the content

Since a custom Navigator will set the NavigatorContext.contextKey to the current _layout, you can use this to determine if you are inside a custom navigator or not.

VectorIcon

Android
iOS
tvOS
Web

Type: React.Element<VectorIconProps<NameT>>

Helper component for loading vector icons.

Prefer using the md and sf props on Icon rather than using this component directly. Only use this component when you need to load a specific icon from a vector icon family.

Example

import { Icon, VectorIcon } from 'expo-router'; import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons'; <Icon src={<VectorIcon family={MaterialCommunityIcons} name="home" />} />

VectorIconProps

family

Android
iOS
tvOS
Web
Type: { getImageSource: (name: NameT, size: number, color: ColorValue) => Promise<ImageSourcePropType | null> }

The family of the vector icon.

Example

import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';

name

Android
iOS
tvOS
Web
Type: NameT

The name of the vector icon.

Link.AppleZoom

iOS 18+

Type: React.Element<LinkAppleZoomProps>

When this component is used inside a Link, zoom transition will be used when navigating to the link's href.

LinkAppleZoomProps

alignmentRect

iOS 18+
Optional • Type: { height: number, width: number, x: number, y: number }

Defines the rectangle used for the zoom transition's alignment. This rectangle is specified in the zoomed screen's coordinate space.

Inherited Props

  • PropsWithChildren

Link.AppleZoomTarget

iOS 18+

Type: React.Iterable<{ children: ReactNode }>

Defines the target for an Apple zoom transition.

Example

import { Link } from 'expo-router'; export default function Screen() { return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <Link.AppleZoomTarget> <Image source={require('../assets/image.png')} style={{ width: 200, height: 200 }} /> </Link.AppleZoomTarget> </View> ); }

Link.Menu

iOS

Type: React.Element<LinkMenuProps>

Groups context menu actions for a link.

If multiple Link.Menu components are used within a single Link, only the first will be rendered. Only Link.MenuAction and Link.Menu components are allowed as children.

Example

<Link.Menu> <Link.MenuAction title="Action 1" onPress={() => {}} /> <Link.MenuAction title="Action 2" onPress={() => {}} /> </Link.Menu>

LinkMenuProps

children

iOS
Optional • Type: ReactNode

destructive

iOS
Optional • Type: boolean

If true, the menu item will be displayed as destructive.

See: Apple documentation for more information.

Deprecated: Use palette prop instead.

displayAsPalette

iOS
Optional • Type: boolean

Deprecated: Use inline prop instead.

displayInline

iOS
Optional • Type: boolean

elementSize

iOS 16.0+
Optional • Literal type: string

The preferred size of the menu elements. elementSize property is ignored when palette is used.

See: Apple documentation for more information.

Acceptable values are: 'small' | 'medium' | 'auto' | 'large'

icon

iOS
Optional • Type: SFSymbols7_0

Optional SF Symbol displayed alongside the menu item.

image

iOS
Optional • Literal type: union

Custom image loaded using useImage() hook from expo-image. Takes priority over icon (SF Symbol) when both are provided.

Example

import { useImage } from 'expo-image'; import { Link } from 'expo-router'; const customIcon = useImage('https://simpleicons.org/icons/expo.svg', { maxWidth: 24, maxHeight: 24, }); <Link.Menu image={customIcon} title="Menu"> <Link.MenuAction title="Action" onPress={() => {}} /> </Link.Menu>

Acceptable values are: ImageRef | null

inline

iOS
Optional • Type: boolean

If true, the menu will be displayed inline. This means that the menu will not be collapsed

See: Apple documentation for more information.

palette

iOS
Optional • Type: boolean

If true, the menu will be displayed as a palette. This means that the menu will be displayed as one row. The elementSize property is ignored when palette is used, all items will be elementSize="small". Use elementSize="medium" instead of palette to display actions with titles horizontally.

Note: Palette menus are only supported in submenus.

See: Apple documentation for more information.

subtitle

iOS
Optional • Type: string

An optional subtitle for the submenu. Does not appear on inline menus.

See: Apple documentation for more information.

title

iOS
Optional • Type: string

The title of the menu item

Link.MenuAction

iOS

Type: React.Element<LinkMenuActionProps>

This component renders a context menu action for a link. It should only be used as a child of Link.Menu or LinkMenu.

LinkMenuActionProps

children

iOS
Optional • Type: ReactNode

The title of the menu item.

destructive

iOS
Optional • Type: boolean

If true, the menu item will be displayed as destructive.

See: Apple documentation for more information.

disabled

iOS
Optional • Type: boolean

If true, the menu item will be disabled and not selectable.

See: Apple documentation for more information.

discoverabilityLabel

iOS
Optional • Type: string

An elaborated title that explains the purpose of the action.

hidden

iOS
Optional • Type: boolean • Default: false

Whether the menu element should be hidden.

See: Apple documentation for more information.

icon

iOS
Optional • Type: SFSymbols7_0

SF Symbol displayed alongside the menu item.

image

iOS
Optional • Literal type: union

Custom image loaded using useImage() hook from expo-image. Takes priority over icon (SF Symbol) when both are provided.

Example

import { useImage } from 'expo-image'; import { Link } from 'expo-router'; const customIcon = useImage('https://simpleicons.org/icons/expo.svg', { maxWidth: 24, maxHeight: 24, }); <Link.Menu title="Menu"> <Link.MenuAction image={customIcon} title="Action" onPress={() => {}} /> </Link.Menu>

Acceptable values are: ImageRef | null

isOn

iOS
Optional • Type: boolean

If true, the menu item will be displayed as selected.

onPress

iOS
Optional • Type: () => void

subtitle

iOS
Optional • Type: string

An optional subtitle for the menu item.

See: Apple documentation for more information.

Deprecated: Use children prop instead.

title

iOS
Optional • Type: string

The title of the menu item.

unstable_keepPresented

iOS
Optional • Type: boolean

If 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.

Link.Preview

iOS

Type: React.Element<LinkPreviewProps>

A component used to render and customize the link preview.

If Link.Preview is used without any props, it will render a preview of the href passed to the Link.

If multiple Link.Preview components are used within a single Link, only the first one will be rendered.

To customize the preview, you can pass custom content as children.

Example

<Link href="/about"> <Link.Preview> <Text>Custom Preview Content</Text> </Link.Preview> </Link>

Example

<Link href="/about"> <Link.Preview /> </Link>

LinkPreviewProps

children

iOS
Optional • Type: ReactNode

style

iOS
Optional • Type: LinkPreviewStyle

Custom styles for the preview container.

Note that some styles may not work, as they are limited or reset by the native view

Link.Trigger

iOS

Type: React.Iterable<LinkTriggerProps>

Serves as the trigger for a link. The content inside this component will be rendered as part of the base link.

If multiple Link.Trigger components are used within a single Link, only the first will be rendered.

Example

<Link href="/about"> <Link.Trigger> Trigger </Link.Trigger> </Link>

LinkTriggerProps

withAppleZoom

iOS 18+
Optional • Type: boolean

A shorthand for enabling the Apple Zoom Transition on this link trigger.

When set to true, the trigger will be wrapped with Link.AppleZoom. If another Link.AppleZoom is already used inside Link.Trigger, an error will be thrown.

Inherited Props

  • PropsWithChildren

Stack.Header

Android
iOS
tvOS
Web

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> ); }

StackHeaderProps

asChild

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

When true, renders children as a custom header component, replacing the default header entirely. Use this to implement fully custom header layouts.

blurEffect

iOS
Optional • Type: BlurEffectTypes

The blur effect to apply to the header background on iOS. Common values include 'regular', 'prominent', 'systemMaterial', etc.

children

Android
iOS
tvOS
Web
Optional • Type: ReactNode

Child elements for custom header when asChild is true.

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether to hide the header completely. When set to true, the header will not be rendered.

largeStyle

iOS
Optional • Type: StyleProp<{ backgroundColor: ColorValue, shadowColor: 'transparent' }>

Style properties for the large title header (iOS).

  • backgroundColor: Background color of the large title header
  • shadowColor: Set to 'transparent' to hide the large title shadow/border

style

Android
iOS
tvOS
Web
Optional • Type: 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 header
  • shadowColor: Set to 'transparent' to hide the header shadow/border

Stack.Screen

Android
iOS
tvOS
Web

Type: React.Element<StackScreenProps>

StackScreenProps

name

Android
iOS
tvOS
Web
Optional • Type: string

options

Android
iOS
tvOS
Web
Optional • Type: NativeStackNavigationOptions

Inherited Props

  • PropsWithChildren

Stack.SearchBar

iOS

Type: React.Element<StackSearchBarProps>

A search bar component that integrates with the native stack header.

Note: Using Stack.SearchBar will 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 /> </> ); }

StackSearchBarProps

Inherited Props

Stack.Toolbar

iOS

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).

Note: Using Stack.Toolbar with placement="left" or placement="right" will automatically make the header visible (headerShown: true), as the toolbar is rendered as part of the native header.

Note: Stack.Toolbar with placement="bottom" can only be used inside page components, not in layout components.

Note: Stack.Toolbar is an experimental API and may change without notice.

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 /> </> ); }

StackToolbarProps

asChild

iOS
Optional • Type: boolean • Default: false

When true, renders children as a custom component in the header area, replacing the default header layout.

Only applies to placement="left" and placement="right".

children

iOS
Optional • Type: ReactNode

Child 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.

placement

iOS
Optional • Type: ToolbarPlacement • Default: 'bottom'

The placement of the toolbar.

  • 'left': Renders items in the left area of the header.
  • 'right': Renders items in the right area of the header.
  • 'bottom': Renders items in the bottom toolbar (iOS only).

Tabs.Screen

Android
iOS
tvOS
Web

Type: React.Element<ScreenProps<TabsProps, TabNavigationState<ParamListBase>, BottomTabNavigationEventMap>>

Stack.Screen.BackButton

iOS

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 /> </> ); }

StackScreenBackButtonProps

children

iOS
Optional • Type: string

The title to display for the back button.

displayMode

iOS
Optional • Type: BackButtonDisplayMode

The display mode for the back button.

hidden

iOS
Optional • Type: boolean

Whether to hide the back button.

src

iOS
Optional • Type: ImageSourcePropType

Custom image source for the back button.

style

iOS
Optional • Type: StyleProp<undefined>

Style for the back button title.

withMenu

iOS
Optional • Type: boolean

Whether to show a context menu when long pressing the back button.

Stack.Screen.Title

iOS

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

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

import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Screen.Title>My Page</Stack.Screen.Title> <ScreenContent /> </> ); }

StackScreenTitleProps

children

iOS
Optional • Type: string

large

iOS
Optional • Type: boolean

largeStyle

iOS
Optional • Type: StyleProp<{ color: string, fontFamily: TextStyle[fontFamily], fontSize: TextStyle[fontSize], fontWeight: Exclude<TextStyle[fontWeight], number> }>

style

iOS
Optional • Type: StyleProp<{ color: string, fontFamily: TextStyle[fontFamily], fontSize: TextStyle[fontSize], fontWeight: Exclude<TextStyle[fontWeight], number>, textAlign: 'left' | 'center' }>

Stack.Toolbar.Badge

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarBadgeProps>>

StackToolbarBadgeProps

children

Android
iOS
tvOS
Web
Optional • Type: string

The text to display as the badge

style

Android
iOS
tvOS
Web
Optional • Type: StyleProp<Pick<TextStyle, 'backgroundColor' | 'color' | 'fontFamily' | 'fontSize' | 'fontWeight'>>

Stack.Toolbar.Button

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarButtonProps>>

StackToolbarButtonProps

accessibilityHint

Android
iOS
tvOS
Web
Optional • Type: string

accessibilityLabel

Android
iOS
tvOS
Web
Optional • Type: string

children

Android
iOS
tvOS
Web
Optional • Type: ReactNode

There 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).

disabled

Android
iOS
tvOS
Web
Optional • Type: boolean

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether the button should be hidden.

hidesSharedBackground

iOS 26+
Optional • Type: boolean

Whether to hide the shared background.

icon

Android
iOS
tvOS
Web
Optional • Literal type: union

Icon 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 the image prop to provide custom images.

Acceptable values are: ImageSourcePropType | SFSymbols7_0

image

Android
iOS
tvOS
Web
Optional • Type: ImageRef

Image to display in the button.

Note: This prop is only supported in toolbar with placement="bottom".

onPress

Android
iOS
tvOS
Web
Optional • Type: () => void

selected

Android
iOS
tvOS
Web
Optional • Type: boolean

Whether the button is in a selected state

See: Apple documentation for more information

separateBackground

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether to separate the background of this item from other header items.

style

Android
iOS
tvOS
Web
Optional • Type: StyleProp<TextStyle>

Style for the label of the header item.

tintColor

Android
iOS
tvOS
Web
Optional • Type: ColorValue

The tint color to apply to the button item

See: Apple documentation for more information.

variant

Android
iOS
tvOS
Web
Optional • Literal type: string • Default: 'plain'

Acceptable values are: 'done' | 'prominent' | 'plain'

Stack.Toolbar.Icon

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarIconProps>>

StackToolbarIconProps

src

Android
iOS
tvOS
Web

sf

Android
iOS
tvOS
Web
Type: SFSymbol

Stack.Toolbar.Label

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarLabelProps>>

StackToolbarLabelProps

children

Android
iOS
tvOS
Web
Optional • Type: string

The text to display as the label for the tab.

Stack.Toolbar.Menu

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarMenuProps>>

StackToolbarMenuProps

accessibilityHint

Android
iOS
tvOS
Web
Optional • Type: string

accessibilityLabel

Android
iOS
tvOS
Web
Optional • Type: string

children

Android
iOS
tvOS
Web
Optional • Type: ReactNode

Menu 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>

destructive

Android
iOS
tvOS
Web
Optional • Type: boolean

If true, the menu item will be displayed as destructive.

See: Apple documentation for more information.

disabled

Android
iOS
tvOS
Web
Optional • Type: boolean

elementSize

iOS 16.0+
Optional • Literal type: string

The 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' | 'medium' | 'auto' | 'large'

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether the menu should be hidden.

hidesSharedBackground

iOS 26+
Optional • Type: boolean

Whether to hide the shared background.

See: Official Apple documentation for more information.

icon

Android
iOS
tvOS
Web
Optional • Literal type: union

Icon 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 the image prop to provide custom images.

Acceptable values are: ImageSourcePropType | SFSymbols7_0

image

Android
iOS
tvOS
Web
Optional • Type: ImageRef

Image to display for the menu item.

Note: This prop is only supported in toolbar with placement="bottom".

inline

Android
iOS
tvOS
Web
Optional • Type: boolean

If 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.

palette

Android
iOS
tvOS
Web
Optional • Type: boolean

If 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.

separateBackground

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether to separate the background of this item from other header items.

style

Android
iOS
tvOS
Web
Optional • Type: StyleProp<BasicTextStyle>

Style for the label of the header item.

tintColor

Android
iOS
tvOS
Web
Optional • Type: ColorValue

The tint color to apply to the button item

See: Apple documentation for more information.

title

Android
iOS
tvOS
Web
Optional • Type: string

Optional title to show on top of the menu.

variant

Android
iOS
tvOS
Web
Optional • Literal type: string • Default: 'plain'

Acceptable values are: 'done' | 'prominent' | 'plain'

Stack.Toolbar.MenuAction

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarMenuActionProps>>

StackToolbarMenuActionProps

children

Android
iOS
tvOS
Web
Optional • Type: ReactNode

Can be an Icon, Label or string title.

destructive

Android
iOS
tvOS
Web
Optional • Type: boolean

If true, the menu item will be displayed as destructive.

See: Apple documentation for more information.

disabled

Android
iOS
tvOS
Web
Optional • Type: boolean

If true, the menu item will be disabled and not selectable.

See: Apple documentation for more information.

discoverabilityLabel

Android
iOS
tvOS
Web
Optional • Type: string

An elaborated title that explains the purpose of the action.

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean

icon

Android
iOS
tvOS
Web
Optional • Literal type: union

Acceptable values are: ImageSourcePropType | SFSymbols7_0

image

Android
iOS
tvOS
Web
Optional • Type: ImageRef

Image to display for the menu action.

Note: This prop is only supported in Stack.Toolbar.Bottom.

isOn

Android
iOS
tvOS
Web
Optional • Type: boolean

If true, the menu item will be displayed as selected.

onPress

Android
iOS
tvOS
Web
Optional • Type: () => void

subtitle

Android
iOS
tvOS
Web
Optional • Type: string

An optional subtitle for the menu item.

See: Apple documentation for more information.

unstable_keepPresented

Android
iOS
tvOS
Web
Optional • Type: boolean

If 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.

Stack.Toolbar.SearchBarSlot

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarSearchBarSlotProps>>

StackToolbarSearchBarSlotProps

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether the search bar slot should be hidden.

hidesSharedBackground

iOS 26+
Optional • Type: boolean

Whether to hide the shared background.

sharesBackground

iOS 26+
Optional • Type: boolean

Whether this search bar slot shares background with adjacent items.

Stack.Toolbar.Spacer

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarSpacerProps>>

StackToolbarSpacerProps

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether the spacer should be hidden.

sharesBackground

iOS 26+
Optional • Type: boolean

Whether this spacer shares background with adjacent items.

Only available in bottom placement.

width

Android
iOS
tvOS
Web
Optional • Type: number

The width of the spacing element.

In Left/Right placements, width is required. In Bottom placement, if width is not provided, the spacer will be flexible and expand to fill available space.

Stack.Toolbar.View

Android
iOS
tvOS
Web

Type: React.Element<FC<StackToolbarViewProps>>

StackToolbarViewProps

asChild

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

When true, renders children as a custom component in the header area, replacing the default header layout.

Only applies to placement="left" and placement="right".

children

Android
iOS
tvOS
Web
Optional • Type: ReactNode

Child 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.

placement

Android
iOS
tvOS
Web
Optional • Type: ToolbarPlacement • Default: 'bottom'

The placement of the toolbar.

  • 'left': Renders items in the left area of the header.
  • 'right': Renders items in the right area of the header.
  • 'bottom': Renders items in the bottom toolbar (iOS only).

children

Android
iOS
tvOS
Web
Optional • Type: ReactElement<unknown, string | JSXElementConstructor<any>>

Can be any React node.

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether the view should be hidden.

hidesSharedBackground

iOS 26+
Optional • Type: boolean

Whether to hide the shared background.

See: Official Apple documentation for more information.

separateBackground

Android
iOS
tvOS
Web
Optional • Type: boolean • Default: false

Whether to separate the background of this item from other items.

Only available in bottom placement.

Constants

Color

Android
iOS

Type: ColorType

Color utility to access platform-specific colors easily.

On Android, it provides access to:

  • System colors, as a type-safe wrapper over PlatformColor. For example, Color.android.background.
  • Attribute colors, as a type-safe wrapper over PlatformColor. For example, Color.android.attr.colorPrimary.
  • Material Design 3 static colors. For example, Color.android.material.primary.
  • Material Design 3 dynamic colors. For example, Color.android.dynamic.primary.

On iOS, it is a type-safe wrapper over PlatformColor, providing access to system colors. For example, Color.ios.label.

Note: To ensure the colors align with the system theme on Android, make sure they are used within a component that responds to theme changes, such as by using the useColorScheme hook from React Native.

Example

import { Color } from 'expo-router'; Color.ios.label; // Access iOS system color Color.android.background; // Access Android system color Color.android.attr.colorPrimary; // Access Android attribute color Color.android.material.primary; // Access Android Material Design 3 static color Color.android.dynamic.primary; // Access Android Material Design 3 dynamic color

Example

import { Color } from 'expo-router'; import { View, Text, useColorScheme } from 'react-native'; export default function MyComponent() { useColorScheme(); // Ensure the app responds to system theme changes return ( <View style={{ flex: 1, backgroundColor: Color.android.dynamic.primary }}> <Text style={{ color: Color.android.dynamic.onPrimary }}> Hello, World! </Text> </View> ); }

unstable_navigationEvents

Android
iOS
tvOS
Web

Type: { addListener: (eventType: EventType, callback: (event: Payload<EventType>) => void) => () => void, emit: (type: EventType, event: Payload<EventType>) => void, enable: () => void, isEnabled: () => boolean, saveCurrentPathname: () => void, }

Hooks

useFocusEffect(effect, do_not_pass_a_second_prop)

Android
iOS
tvOS
Web
ParameterTypeDescription
effectEffectCallback

Memoized callback containing the effect, should optionally return a cleanup function.

do_not_pass_a_second_prop(optional)undefined
-

Hook to run an effect whenever a route is focused. Similar to React.useEffect.

This can be used to perform side-effects such as fetching data or subscribing to events. The passed callback should be wrapped in React.useCallback to avoid running the effect too often.

Returns:
void

Example

import { useFocusEffect } from 'expo-router'; import { useCallback } from 'react'; export default function Route() { useFocusEffect( // Callback should be wrapped in `React.useCallback` to avoid running the effect too often. useCallback(() => { // Invoked whenever the route is focused. console.log("Hello, I'm focused!"); // Return function is invoked whenever the route gets out of focus. return () => { console.log('This route is now unfocused.'); }; }, []), ); return </>; }

useGlobalSearchParams()

Android
iOS
tvOS
Web

Returns URL parameters for globally selected route, including dynamic path segments. This function updates even when the route is not focused. Useful for analytics or other background operations that don't draw to the screen.

Route URL example: acme://profile/baconbrix?extra=info.

When querying search params in a stack, opt-towards using useLocalSearchParams because it will only update when the route is focused.

Note: For usage information, see Local versus global search parameters.

Returns:
RouteParams<TRoute> & TParams

Example

app/profile/[user].tsx
import { Text } from 'react-native'; import { useGlobalSearchParams } from 'expo-router'; export default function Route() { // user=baconbrix & extra=info const { user, extra } = useGlobalSearchParams(); return <Text>User: {user}</Text>; }

useIsPreview()

Android
iOS
tvOS
Web

Hook to determine if the current route is rendered inside a preview.

Returns:
boolean
  • True if the current route is rendered inside a preview, false otherwise.

useLoaderData()

Android
iOS
tvOS
Web

Returns the result of the loader function for the calling route.

Example

app/profile/[user].tsx
import { Text } from 'react-native'; import { useLoaderData } from 'expo-router'; export function loader() { return Promise.resolve({ foo: 'bar' }} } export default function Route() { // { foo: 'bar' } const data = useLoaderData<typeof loader>(); return <Text>Data: {JSON.stringify(data)}</Text>; }

useLocalSearchParams()

Android
iOS
tvOS
Web

Returns the URL parameters for the contextually focused route. Useful for stacks where you may push a new screen that changes the query parameters. For dynamic routes, both the route parameters and the search parameters are returned.

Route URL example: acme://profile/baconbrix?extra=info.

To observe updates even when the invoking route is not focused, use useGlobalSearchParams.

Note: For usage information, see Local versus global search parameters.

Returns:
RouteParams<TRoute> & TParams

Example

app/profile/[user].tsx
import { Text } from 'react-native'; import { useLocalSearchParams } from 'expo-router'; export default function Route() { // user=baconbrix & extra=info const { user, extra } = useLocalSearchParams(); return <Text>User: {user}</Text>; }

useNavigation(parent)

Android
iOS
tvOS
Web
ParameterTypeDescription
parent(optional)string | HrefObject

Provide an absolute path such as /(root) to the parent route or a relative path like ../../ to the parent route.


Returns the underlying React Navigation navigation object to imperatively access layout-specific functionality like navigation.openDrawer() in a Drawer layout.

Returns:
T

The navigation object for the current route.

See: React Navigation documentation on navigation dependent functions for more information.

Example

app/index.tsx
import { useNavigation } from 'expo-router'; export default function Route() { // Access the current navigation object for the current route. const navigation = useNavigation(); return ( <View> <Text onPress={() => { // Open the drawer view. navigation.openDrawer(); }}> Open Drawer </Text> </View> ); }

When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route. For example, /menu/_layout.tsx is nested inside /app/orders/, you can use useNavigation('/orders/menu/').

Example

app/orders/menu/index.tsx
import { useNavigation } from 'expo-router'; export default function MenuRoute() { const rootLayout = useNavigation('/'); const ordersLayout = useNavigation('/orders'); // Same as the default results of `useNavigation()` when invoked in this route. const parentLayout = useNavigation('/orders/menu'); }

If you attempt to access a layout that doesn't exist, an error such as Could not find parent navigation with route "/non-existent" is thrown.

useNavigationContainerRef()

Android
iOS
tvOS
Web
Returns:
NavigationContainerRefWithCurrent<RootParamList>

The root <NavigationContainer /> ref for the app. The ref.current may be null if the <NavigationContainer /> hasn't mounted yet.

usePathname()

Android
iOS
tvOS
Web

Returns the currently selected route location without search parameters. For example, /acme?foo=bar returns /acme. Segments will be normalized. For example, /[id]?id=normal becomes /normal.

Returns:
string

Example

app/profile/[user].tsx
import { Text } from 'react-native'; import { usePathname } from 'expo-router'; export default function Route() { // pathname = "/profile/baconbrix" const pathname = usePathname(); return <Text>Pathname: {pathname}</Text>; }

usePreventZoomTransitionDismissal(_options)

iOS
ParameterType
_options(optional)UsePreventZoomTransitionDismissalOptions

Limits the screen area where interactive dismissal gestures are allowed for zoom transitions.

This hook must be called from the destination screen of a zoom transition (the screen you navigate to, not the source). It restricts where app users can start swipe gestures to dismiss the screen and return to the previous screen.

When a dismissal gesture starts inside the bounds, the screen can be dismissed. When a dismissal gesture starts outside the bounds, dismissal is blocked completely. Undefined coordinates place no restriction on that dimension.

Note: Only one instance of this hook should be used per screen. If multiple instances exist, the last one to render will take effect.

Returns:
void

Example

// In your destination screen (e.g., app/image.tsx) import { usePreventZoomTransitionDismissal } from 'expo-router'; import { useWindowDimensions } from 'react-native'; import { Image } from 'expo-image'; export default function ImageScreen() { const dimensions = useWindowDimensions(); // Only allow dismissal from the bottom 200px of the screen usePreventZoomTransitionDismissal({ unstable_dismissalBoundsRect: { minY: dimensions.height - 200 } }); return <Image source={...} style={{ flex: 1 }} />; }

Deprecated: Use useNavigationContainerRef instead, which returns a React ref.

useRootNavigation()

Android
iOS
tvOS
Web

useRootNavigationState()

Android
iOS
tvOS
Web

Returns the navigation state of the navigator which contains the current screen.

Returns:
Readonly<undefined>

Example

import { useRootNavigationState } from 'expo-router'; export default function Route() { const { routes } = useRootNavigationState(); return <Text>{routes[0].name}</Text>; }

useRouter()

Android
iOS
tvOS
Web

Returns the Router object for imperative navigation.

Returns:
Router

Example

import { useRouter } from 'expo-router'; import { Text } from 'react-native'; export default function Route() { const router = useRouter(); return ( <Text onPress={() => router.push('/home')}>Go Home</Text> ); }

useSegments()

Android
iOS
tvOS
Web

Returns a list of selected file segments for the currently selected route. Segments are not normalized, so they will be the same as the file path. For example, /[id]?id=normal becomes ["[id]"].

Returns:
RouteSegments<TSegments>

Example

app/profile/[user].tsx
import { Text } from 'react-native'; import { useSegments } from 'expo-router'; export default function Route() { // segments = ["profile", "[user]"] const segments = useSegments(); return <Text>Hello</Text>; }

useSegments can be typed using an abstract. Consider the following file structure:

- app - [user] - index.tsx - followers.tsx - settings.tsx

This can be strictly typed using the following abstract with useSegments hook:

const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()

useSitemap()

Android
iOS
tvOS
Web
Returns:
SitemapType | null

Methods

Sitemap()

Android
iOS
tvOS
Web
Returns:
Element

withLayoutContext(Nav, processor, useOnlyUserDefinedScreens)

Android
iOS
tvOS
Web
ParameterTypeDescription
NavT

The navigator component to wrap.

processor(optional)(options: ScreenProps[]) => ScreenProps[]

A function that processes the screens before passing them to the navigator.

useOnlyUserDefinedScreens(optional)boolean

If true, all screens not specified as navigator's children will be ignored.

Default:false

Returns a navigator that automatically injects matched routes and renders nothing when there are no children. Return type with children prop optional.

Enables use of other built-in React Navigation navigators and other navigators built with the React Navigation custom navigator API.

Returns:
Component<PropsWithoutRef<PickPartial<ComponentProps<T>, 'children'>>> & { Protected: FunctionComponent<ProtectedProps>, Screen: (props: ScreenProps<TOptions, TState, TEventMap>) => null }

Example

app/_layout.tsx
import { ParamListBase, TabNavigationState } from "@react-navigation/native"; import { createMaterialTopTabNavigator, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, } from "@react-navigation/material-top-tabs"; import { withLayoutContext } from "expo-router"; const MaterialTopTabs = createMaterialTopTabNavigator(); const ExpoRouterMaterialTopTabs = withLayoutContext< MaterialTopTabNavigationOptions, typeof MaterialTopTabs.Navigator, TabNavigationState<ParamListBase>, MaterialTopTabNavigationEventMap >(MaterialTopTabs.Navigator); export default function TabLayout() { return <ExpoRouterMaterialTopTabs />; }

Interfaces

AndroidBaseColorSDK1

Android
iOS
tvOS
Web
PropertyTypeDescription
background_darkColorValue

PlatformColor("@android:color/background_dark")

background_lightColorValue

PlatformColor("@android:color/background_light")

blackColorValue

PlatformColor("@android:color/black")

darker_grayColorValue

PlatformColor("@android:color/darker_gray")

tab_indicator_textColorValue

PlatformColor("@android:color/tab_indicator_text")

transparentColorValue

PlatformColor("@android:color/transparent")

whiteColorValue

PlatformColor("@android:color/white")

widget_edittext_darkColorValue

PlatformColor("@android:color/widget_edittext_dark")

AndroidBaseColorSDK14

Android
iOS
tvOS
Web
PropertyTypeDescription
holo_blue_brightColorValue

PlatformColor("@android:color/holo_blue_bright")

holo_blue_darkColorValue

PlatformColor("@android:color/holo_blue_dark")

holo_blue_lightColorValue

PlatformColor("@android:color/holo_blue_light")

holo_green_darkColorValue

PlatformColor("@android:color/holo_green_dark")

holo_green_lightColorValue

PlatformColor("@android:color/holo_green_light")

holo_orange_darkColorValue

PlatformColor("@android:color/holo_orange_dark")

holo_orange_lightColorValue

PlatformColor("@android:color/holo_orange_light")

holo_purpleColorValue

PlatformColor("@android:color/holo_purple")

holo_red_darkColorValue

PlatformColor("@android:color/holo_red_dark")

holo_red_lightColorValue

PlatformColor("@android:color/holo_red_light")

AndroidBaseColorSDK31

Android
iOS
tvOS
Web
PropertyTypeDescription
system_accent1_0ColorValue

PlatformColor("@android:color/system_accent1_0")

system_accent1_10ColorValue

PlatformColor("@android:color/system_accent1_10")

system_accent1_100ColorValue

PlatformColor("@android:color/system_accent1_100")

system_accent1_1000ColorValue

PlatformColor("@android:color/system_accent1_1000")

system_accent1_200ColorValue

PlatformColor("@android:color/system_accent1_200")

system_accent1_300ColorValue

PlatformColor("@android:color/system_accent1_300")

system_accent1_400ColorValue

PlatformColor("@android:color/system_accent1_400")

system_accent1_50ColorValue

PlatformColor("@android:color/system_accent1_50")

system_accent1_500ColorValue

PlatformColor("@android:color/system_accent1_500")

system_accent1_600ColorValue

PlatformColor("@android:color/system_accent1_600")

system_accent1_700ColorValue

PlatformColor("@android:color/system_accent1_700")

system_accent1_800ColorValue

PlatformColor("@android:color/system_accent1_800")

system_accent1_900ColorValue

PlatformColor("@android:color/system_accent1_900")

system_accent2_0ColorValue

PlatformColor("@android:color/system_accent2_0")

system_accent2_10ColorValue

PlatformColor("@android:color/system_accent2_10")

system_accent2_100ColorValue

PlatformColor("@android:color/system_accent2_100")

system_accent2_1000ColorValue

PlatformColor("@android:color/system_accent2_1000")

system_accent2_200ColorValue

PlatformColor("@android:color/system_accent2_200")

system_accent2_300ColorValue

PlatformColor("@android:color/system_accent2_300")

system_accent2_400ColorValue

PlatformColor("@android:color/system_accent2_400")

system_accent2_50ColorValue

PlatformColor("@android:color/system_accent2_50")

system_accent2_500ColorValue

PlatformColor("@android:color/system_accent2_500")

system_accent2_600ColorValue

PlatformColor("@android:color/system_accent2_600")

system_accent2_700ColorValue

PlatformColor("@android:color/system_accent2_700")

system_accent2_800ColorValue

PlatformColor("@android:color/system_accent2_800")

system_accent2_900ColorValue

PlatformColor("@android:color/system_accent2_900")

system_accent3_0ColorValue

PlatformColor("@android:color/system_accent3_0")

system_accent3_10ColorValue

PlatformColor("@android:color/system_accent3_10")

system_accent3_100ColorValue

PlatformColor("@android:color/system_accent3_100")

system_accent3_1000ColorValue

PlatformColor("@android:color/system_accent3_1000")

system_accent3_200ColorValue

PlatformColor("@android:color/system_accent3_200")

system_accent3_300ColorValue

PlatformColor("@android:color/system_accent3_300")

system_accent3_400ColorValue

PlatformColor("@android:color/system_accent3_400")

system_accent3_50ColorValue

PlatformColor("@android:color/system_accent3_50")

system_accent3_500ColorValue

PlatformColor("@android:color/system_accent3_500")

system_accent3_600ColorValue

PlatformColor("@android:color/system_accent3_600")

system_accent3_700ColorValue

PlatformColor("@android:color/system_accent3_700")

system_accent3_800ColorValue

PlatformColor("@android:color/system_accent3_800")

system_accent3_900ColorValue

PlatformColor("@android:color/system_accent3_900")

system_neutral1_0ColorValue

PlatformColor("@android:color/system_neutral1_0")

system_neutral1_10ColorValue

PlatformColor("@android:color/system_neutral1_10")

system_neutral1_100ColorValue

PlatformColor("@android:color/system_neutral1_100")

system_neutral1_1000ColorValue

PlatformColor("@android:color/system_neutral1_1000")

system_neutral1_200ColorValue

PlatformColor("@android:color/system_neutral1_200")

system_neutral1_300ColorValue

PlatformColor("@android:color/system_neutral1_300")

system_neutral1_400ColorValue

PlatformColor("@android:color/system_neutral1_400")

system_neutral1_50ColorValue

PlatformColor("@android:color/system_neutral1_50")

system_neutral1_500ColorValue

PlatformColor("@android:color/system_neutral1_500")

system_neutral1_600ColorValue

PlatformColor("@android:color/system_neutral1_600")

system_neutral1_700ColorValue

PlatformColor("@android:color/system_neutral1_700")

system_neutral1_800ColorValue

PlatformColor("@android:color/system_neutral1_800")

system_neutral1_900ColorValue

PlatformColor("@android:color/system_neutral1_900")

system_neutral2_0ColorValue

PlatformColor("@android:color/system_neutral2_0")

system_neutral2_10ColorValue

PlatformColor("@android:color/system_neutral2_10")

system_neutral2_100ColorValue

PlatformColor("@android:color/system_neutral2_100")

system_neutral2_1000ColorValue

PlatformColor("@android:color/system_neutral2_1000")

system_neutral2_200ColorValue

PlatformColor("@android:color/system_neutral2_200")

system_neutral2_300ColorValue

PlatformColor("@android:color/system_neutral2_300")

system_neutral2_400ColorValue

PlatformColor("@android:color/system_neutral2_400")

system_neutral2_50ColorValue

PlatformColor("@android:color/system_neutral2_50")

system_neutral2_500ColorValue

PlatformColor("@android:color/system_neutral2_500")

system_neutral2_600ColorValue

PlatformColor("@android:color/system_neutral2_600")

system_neutral2_700ColorValue

PlatformColor("@android:color/system_neutral2_700")

system_neutral2_800ColorValue

PlatformColor("@android:color/system_neutral2_800")

system_neutral2_900ColorValue

PlatformColor("@android:color/system_neutral2_900")

AndroidBaseColorSDK34

Android
iOS
tvOS
Web
PropertyTypeDescription
system_background_darkColorValue

PlatformColor("@android:color/system_background_dark")

system_background_lightColorValue

PlatformColor("@android:color/system_background_light")

system_control_activated_darkColorValue

PlatformColor("@android:color/system_control_activated_dark")

system_control_activated_lightColorValue

PlatformColor("@android:color/system_control_activated_light")

system_control_highlight_darkColorValue

PlatformColor("@android:color/system_control_highlight_dark")

system_control_highlight_lightColorValue

PlatformColor("@android:color/system_control_highlight_light")

system_control_normal_darkColorValue

PlatformColor("@android:color/system_control_normal_dark")

system_control_normal_lightColorValue

PlatformColor("@android:color/system_control_normal_light")

system_error_container_darkColorValue

PlatformColor("@android:color/system_error_container_dark")

system_error_container_lightColorValue

PlatformColor("@android:color/system_error_container_light")

system_error_darkColorValue

PlatformColor("@android:color/system_error_dark")

system_error_lightColorValue

PlatformColor("@android:color/system_error_light")

system_on_background_darkColorValue

PlatformColor("@android:color/system_on_background_dark")

system_on_background_lightColorValue

PlatformColor("@android:color/system_on_background_light")

system_on_error_container_darkColorValue

PlatformColor("@android:color/system_on_error_container_dark")

system_on_error_container_lightColorValue

PlatformColor("@android:color/system_on_error_container_light")

system_on_error_darkColorValue

PlatformColor("@android:color/system_on_error_dark")

system_on_error_lightColorValue

PlatformColor("@android:color/system_on_error_light")

system_on_primary_container_darkColorValue

PlatformColor("@android:color/system_on_primary_container_dark")

system_on_primary_container_lightColorValue

PlatformColor("@android:color/system_on_primary_container_light")

system_on_primary_darkColorValue

PlatformColor("@android:color/system_on_primary_dark")

system_on_primary_fixedColorValue

PlatformColor("@android:color/system_on_primary_fixed")

system_on_primary_fixed_variantColorValue

PlatformColor("@android:color/system_on_primary_fixed_variant")

system_on_primary_lightColorValue

PlatformColor("@android:color/system_on_primary_light")

system_on_secondary_container_darkColorValue

PlatformColor("@android:color/system_on_secondary_container_dark")

system_on_secondary_container_lightColorValue

PlatformColor("@android:color/system_on_secondary_container_light")

system_on_secondary_darkColorValue

PlatformColor("@android:color/system_on_secondary_dark")

system_on_secondary_fixedColorValue

PlatformColor("@android:color/system_on_secondary_fixed")

system_on_secondary_fixed_variantColorValue

PlatformColor("@android:color/system_on_secondary_fixed_variant")

system_on_secondary_lightColorValue

PlatformColor("@android:color/system_on_secondary_light")

system_on_surface_darkColorValue

PlatformColor("@android:color/system_on_surface_dark")

system_on_surface_lightColorValue

PlatformColor("@android:color/system_on_surface_light")

system_on_surface_variant_darkColorValue

PlatformColor("@android:color/system_on_surface_variant_dark")

system_on_surface_variant_lightColorValue

PlatformColor("@android:color/system_on_surface_variant_light")

system_on_tertiary_container_darkColorValue

PlatformColor("@android:color/system_on_tertiary_container_dark")

system_on_tertiary_container_lightColorValue

PlatformColor("@android:color/system_on_tertiary_container_light")

system_on_tertiary_darkColorValue

PlatformColor("@android:color/system_on_tertiary_dark")

system_on_tertiary_fixedColorValue

PlatformColor("@android:color/system_on_tertiary_fixed")

system_on_tertiary_fixed_variantColorValue

PlatformColor("@android:color/system_on_tertiary_fixed_variant")

system_on_tertiary_lightColorValue

PlatformColor("@android:color/system_on_tertiary_light")

system_outline_darkColorValue

PlatformColor("@android:color/system_outline_dark")

system_outline_lightColorValue

PlatformColor("@android:color/system_outline_light")

system_outline_variant_darkColorValue

PlatformColor("@android:color/system_outline_variant_dark")

system_outline_variant_lightColorValue

PlatformColor("@android:color/system_outline_variant_light")

system_palette_key_color_neutral_darkColorValue

PlatformColor("@android:color/system_palette_key_color_neutral_dark")

system_palette_key_color_neutral_lightColorValue

PlatformColor("@android:color/system_palette_key_color_neutral_light")

system_palette_key_color_neutral_variant_darkColorValue

PlatformColor("@android:color/system_palette_key_color_neutral_variant_dark")

system_palette_key_color_neutral_variant_lightColorValue

PlatformColor("@android:color/system_palette_key_color_neutral_variant_light")

system_palette_key_color_primary_darkColorValue

PlatformColor("@android:color/system_palette_key_color_primary_dark")

system_palette_key_color_primary_lightColorValue

PlatformColor("@android:color/system_palette_key_color_primary_light")

system_palette_key_color_secondary_darkColorValue

PlatformColor("@android:color/system_palette_key_color_secondary_dark")

system_palette_key_color_secondary_lightColorValue

PlatformColor("@android:color/system_palette_key_color_secondary_light")

system_palette_key_color_tertiary_darkColorValue

PlatformColor("@android:color/system_palette_key_color_tertiary_dark")

system_palette_key_color_tertiary_lightColorValue

PlatformColor("@android:color/system_palette_key_color_tertiary_light")

system_primary_container_darkColorValue

PlatformColor("@android:color/system_primary_container_dark")

system_primary_container_lightColorValue

PlatformColor("@android:color/system_primary_container_light")

system_primary_darkColorValue

PlatformColor("@android:color/system_primary_dark")

system_primary_fixedColorValue

PlatformColor("@android:color/system_primary_fixed")

system_primary_fixed_dimColorValue

PlatformColor("@android:color/system_primary_fixed_dim")

system_primary_lightColorValue

PlatformColor("@android:color/system_primary_light")

system_secondary_container_darkColorValue

PlatformColor("@android:color/system_secondary_container_dark")

system_secondary_container_lightColorValue

PlatformColor("@android:color/system_secondary_container_light")

system_secondary_darkColorValue

PlatformColor("@android:color/system_secondary_dark")

system_secondary_fixedColorValue

PlatformColor("@android:color/system_secondary_fixed")

system_secondary_fixed_dimColorValue

PlatformColor("@android:color/system_secondary_fixed_dim")

system_secondary_lightColorValue

PlatformColor("@android:color/system_secondary_light")

system_surface_bright_darkColorValue

PlatformColor("@android:color/system_surface_bright_dark")

system_surface_bright_lightColorValue

PlatformColor("@android:color/system_surface_bright_light")

system_surface_container_darkColorValue

PlatformColor("@android:color/system_surface_container_dark")

system_surface_container_high_darkColorValue

PlatformColor("@android:color/system_surface_container_high_dark")

system_surface_container_high_lightColorValue

PlatformColor("@android:color/system_surface_container_high_light")

system_surface_container_highest_darkColorValue

PlatformColor("@android:color/system_surface_container_highest_dark")

system_surface_container_highest_lightColorValue

PlatformColor("@android:color/system_surface_container_highest_light")

system_surface_container_lightColorValue

PlatformColor("@android:color/system_surface_container_light")

system_surface_container_low_darkColorValue

PlatformColor("@android:color/system_surface_container_low_dark")

system_surface_container_low_lightColorValue

PlatformColor("@android:color/system_surface_container_low_light")

system_surface_container_lowest_darkColorValue

PlatformColor("@android:color/system_surface_container_lowest_dark")

system_surface_container_lowest_lightColorValue

PlatformColor("@android:color/system_surface_container_lowest_light")

system_surface_darkColorValue

PlatformColor("@android:color/system_surface_dark")

system_surface_dim_darkColorValue

PlatformColor("@android:color/system_surface_dim_dark")

system_surface_dim_lightColorValue

PlatformColor("@android:color/system_surface_dim_light")

system_surface_lightColorValue

PlatformColor("@android:color/system_surface_light")

system_surface_variant_darkColorValue

PlatformColor("@android:color/system_surface_variant_dark")

system_surface_variant_lightColorValue

PlatformColor("@android:color/system_surface_variant_light")

system_tertiary_container_darkColorValue

PlatformColor("@android:color/system_tertiary_container_dark")

system_tertiary_container_lightColorValue

PlatformColor("@android:color/system_tertiary_container_light")

system_tertiary_darkColorValue

PlatformColor("@android:color/system_tertiary_dark")

system_tertiary_fixedColorValue

PlatformColor("@android:color/system_tertiary_fixed")

system_tertiary_fixed_dimColorValue

PlatformColor("@android:color/system_tertiary_fixed_dim")

system_tertiary_lightColorValue

PlatformColor("@android:color/system_tertiary_light")

system_text_hint_inverse_darkColorValue

PlatformColor("@android:color/system_text_hint_inverse_dark")

system_text_hint_inverse_lightColorValue

PlatformColor("@android:color/system_text_hint_inverse_light")

system_text_primary_inverse_darkColorValue

PlatformColor("@android:color/system_text_primary_inverse_dark")

system_text_primary_inverse_disable_only_darkColorValue

PlatformColor("@android:color/system_text_primary_inverse_disable_only_dark")

system_text_primary_inverse_disable_only_lightColorValue

PlatformColor("@android:color/system_text_primary_inverse_disable_only_light")

system_text_primary_inverse_lightColorValue

PlatformColor("@android:color/system_text_primary_inverse_light")

system_text_secondary_and_tertiary_inverse_darkColorValue

PlatformColor("@android:color/system_text_secondary_and_tertiary_inverse_dark")

system_text_secondary_and_tertiary_inverse_disabled_darkColorValue

PlatformColor("@android:color/system_text_secondary_and_tertiary_inverse_disabled_dark")

system_text_secondary_and_tertiary_inverse_disabled_lightColorValue

PlatformColor("@android:color/system_text_secondary_and_tertiary_inverse_disabled_light")

system_text_secondary_and_tertiary_inverse_lightColorValue

PlatformColor("@android:color/system_text_secondary_and_tertiary_inverse_light")

AndroidBaseColorSDK35

Android
iOS
tvOS
Web
PropertyTypeDescription
system_error_0ColorValue

PlatformColor("@android:color/system_error_0")

system_error_10ColorValue

PlatformColor("@android:color/system_error_10")

system_error_100ColorValue

PlatformColor("@android:color/system_error_100")

system_error_1000ColorValue

PlatformColor("@android:color/system_error_1000")

system_error_200ColorValue

PlatformColor("@android:color/system_error_200")

system_error_300ColorValue

PlatformColor("@android:color/system_error_300")

system_error_400ColorValue

PlatformColor("@android:color/system_error_400")

system_error_50ColorValue

PlatformColor("@android:color/system_error_50")

system_error_500ColorValue

PlatformColor("@android:color/system_error_500")

system_error_600ColorValue

PlatformColor("@android:color/system_error_600")

system_error_700ColorValue

PlatformColor("@android:color/system_error_700")

system_error_800ColorValue

PlatformColor("@android:color/system_error_800")

system_error_900ColorValue

PlatformColor("@android:color/system_error_900")

system_on_surface_disabledColorValue

PlatformColor("@android:color/system_on_surface_disabled")

system_outline_disabledColorValue

PlatformColor("@android:color/system_outline_disabled")

system_surface_disabledColorValue

PlatformColor("@android:color/system_surface_disabled")

AndroidColorAttrSDK1

Android
iOS
tvOS
Web
PropertyTypeDescription
colorBackgroundColorValue

PlatformColor("?attr/colorBackground")

colorForegroundColorValue

PlatformColor("?attr/colorForeground")

colorForegroundInverseColorValue

PlatformColor("?attr/colorForegroundInverse")

AndroidColorAttrSDK14

Android
iOS
tvOS
Web
PropertyTypeDescription
colorActivatedHighlightColorValue

PlatformColor("?attr/colorActivatedHighlight")

colorFocusedHighlightColorValue

PlatformColor("?attr/colorFocusedHighlight")

colorLongPressedHighlightColorValue

PlatformColor("?attr/colorLongPressedHighlight")

colorMultiSelectHighlightColorValue

PlatformColor("?attr/colorMultiSelectHighlight")

colorPressedHighlightColorValue

PlatformColor("?attr/colorPressedHighlight")

AndroidColorAttrSDK21

Android
iOS
tvOS
Web
PropertyTypeDescription
colorAccentColorValue

PlatformColor("?attr/colorAccent")

colorButtonNormalColorValue

PlatformColor("?attr/colorButtonNormal")

colorControlActivatedColorValue

PlatformColor("?attr/colorControlActivated")

colorControlHighlightColorValue

PlatformColor("?attr/colorControlHighlight")

colorControlNormalColorValue

PlatformColor("?attr/colorControlNormal")

colorEdgeEffectColorValue

PlatformColor("?attr/colorEdgeEffect")

colorPrimaryColorValue

PlatformColor("?attr/colorPrimary")

colorPrimaryDarkColorValue

PlatformColor("?attr/colorPrimaryDark")

AndroidColorAttrSDK23

Android
iOS
tvOS
Web
PropertyTypeDescription
colorBackgroundFloatingColorValue

PlatformColor("?attr/colorBackgroundFloating")

AndroidColorAttrSDK25

Android
iOS
tvOS
Web
PropertyTypeDescription
colorSecondaryColorValue

PlatformColor("?attr/colorSecondary")

AndroidColorAttrSDK26

Android
iOS
tvOS
Web
PropertyTypeDescription
colorErrorColorValue

PlatformColor("?attr/colorError")

colorModeColorValue

PlatformColor("?attr/colorMode")

AndroidColorAttrSDK5

Android
iOS
tvOS
Web
PropertyTypeDescription
colorBackgroundCacheHintColorValue

PlatformColor("?attr/colorBackgroundCacheHint")

AndroidDeprecatedColor

Android
iOS
tvOS
Web
PropertyTypeDescription
primary_text_darkColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/primary_text_dark")

primary_text_dark_nodisableColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/primary_text_dark_nodisable")

primary_text_lightColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/primary_text_light")

primary_text_light_nodisableColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/primary_text_light_nodisable")

secondary_text_darkColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/secondary_text_dark")

secondary_text_dark_nodisableColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/secondary_text_dark_nodisable")

secondary_text_lightColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/secondary_text_light")

secondary_text_light_nodisableColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/secondary_text_light_nodisable")

tertiary_text_darkColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/tertiary_text_dark")

tertiary_text_lightColorValue

Deprecated: Deprecated in Android SDK 28

PlatformColor("@android:color/tertiary_text_light")

AndroidDynamicMaterialColorType

Android
iOS
tvOS
Web

Android Dynamic Material Colors

You can find out more about color roles in official Material Design 3 documentation.

You can read about the difference between dynamic and static colors in official Material Design 3 documentation.

For a detailed definition of each color role, see material components color documentation.

PropertyTypeDescription
backgroundColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

errorColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Error color role

errorContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Error color role

onBackgroundColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

onErrorColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Error color role

onErrorContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Error color role

onPrimaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

onPrimaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

onPrimaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

onPrimaryFixedVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

onSecondaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

onSecondaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

onSecondaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

onSecondaryFixedVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

onSurfaceColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

onSurfaceInverseColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

Read more about Inverse colors

onSurfaceVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

onTertiaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

onTertiaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

onTertiaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

onTertiaryFixedVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

outlineColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Outline color role

outlineVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Outline color role

primaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

primaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

primaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

primaryFixedDimColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

primaryInverseColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Primary color role

Read more about Inverse colors

secondaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

secondaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

secondaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

secondaryFixedDimColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Secondary color role

surfaceColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceBrightColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceContainerHighColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceContainerHighestColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceContainerLowColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceContainerLowestColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceDimColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

surfaceInverseColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

Read more about Inverse colors

surfaceVariantColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Surface color role

tertiaryColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

tertiaryContainerColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

tertiaryFixedColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

tertiaryFixedDimColorValue

Android Dynamic Material Colors

This color adapts based on the user's wallpaper and theme settings.

Read more about Tertiary color role

AndroidStaticMaterialColorType

Android
iOS
tvOS
Web

Android Static Material Colors

You can find out more about color roles in official Material Design 3 documentation.

You can read about the difference between dynamic and static colors in official Material Design 3 documentation.

For a detailed definition of each color role, see material components color documentation.

PropertyTypeDescription
backgroundColorValue
errorColorValue
errorContainerColorValue
onBackgroundColorValue
onErrorColorValue
onErrorContainerColorValue
onPrimaryColorValue
onPrimaryContainerColorValue
onPrimaryFixedColorValue
onPrimaryFixedVariantColorValue
onSecondaryColorValue
onSecondaryContainerColorValue
onSecondaryFixedColorValue
onSecondaryFixedVariantColorValue
onSurfaceColorValue
onSurfaceInverseColorValue
onSurfaceVariantColorValue
onTertiaryColorValue
onTertiaryContainerColorValue
onTertiaryFixedColorValue
onTertiaryFixedVariantColorValue
outlineColorValue
outlineVariantColorValue
primaryColorValue
primaryContainerColorValue
primaryFixedColorValue
primaryFixedDimColorValue
primaryInverseColorValue
secondaryColorValue
secondaryContainerColorValue
secondaryFixedColorValue
secondaryFixedDimColorValue
surfaceColorValue
surfaceBrightColorValue
surfaceContainerColorValue
surfaceContainerHighColorValue
surfaceContainerHighestColorValue
surfaceContainerLowColorValue
surfaceContainerLowestColorValue
surfaceDimColorValue
surfaceInverseColorValue
surfaceVariantColorValue
tertiaryColorValue
tertiaryContainerColorValue
tertiaryFixedColorValue
tertiaryFixedDimColorValue

DismissalBoundsRect

iOS

Defines the screen bounds where interactive dismissal gestures are allowed for zoom transitions.

PropertyTypeDescription
maxX(optional)number

Maximum X coordinate (right edge) where dismissal gestures are allowed.

maxY(optional)number

Maximum Y coordinate (bottom edge) where dismissal gestures are allowed.

minX(optional)number

Minimum X coordinate (left edge) where dismissal gestures are allowed.

minY(optional)number

Minimum Y coordinate (top edge) where dismissal gestures are allowed.

IOSBaseColor

Android
iOS
tvOS
Web
PropertyTypeDescription
darkTextColorValue

PlatformColor("darkText")

labelColorValue

PlatformColor("label")

lightTextColorValue

PlatformColor("lightText")

linkColorValue

PlatformColor("link")

opaqueSeparatorColorValue

PlatformColor("opaqueSeparator")

placeholderTextColorValue

PlatformColor("placeholderText")

quaternaryLabelColorValue

PlatformColor("quaternaryLabel")

quaternarySystemFillColorValue

PlatformColor("quaternarySystemFill")

secondaryLabelColorValue

PlatformColor("secondaryLabel")

secondarySystemBackgroundColorValue

PlatformColor("secondarySystemBackground")

secondarySystemFillColorValue

PlatformColor("secondarySystemFill")

secondarySystemGroupedBackgroundColorValue

PlatformColor("secondarySystemGroupedBackground")

separatorColorValue

PlatformColor("separator")

systemBackgroundColorValue

PlatformColor("systemBackground")

systemBlueColorValue

PlatformColor("systemBlue")

systemBrownColorValue

PlatformColor("systemBrown")

systemCyanColorValue

PlatformColor("systemCyan")

systemFillColorValue

PlatformColor("systemFill")

systemGrayColorValue

PlatformColor("systemGray")

systemGray2ColorValue

PlatformColor("systemGray2")

systemGray3ColorValue

PlatformColor("systemGray3")

systemGray4ColorValue

PlatformColor("systemGray4")

systemGray5ColorValue

PlatformColor("systemGray5")

systemGray6ColorValue

PlatformColor("systemGray6")

systemGreenColorValue

PlatformColor("systemGreen")

systemGroupedBackgroundColorValue

PlatformColor("systemGroupedBackground")

systemIndigoColorValue

PlatformColor("systemIndigo")

systemMintColorValue

PlatformColor("systemMint")

systemOrangeColorValue

PlatformColor("systemOrange")

systemPinkColorValue

PlatformColor("systemPink")

systemPurpleColorValue

PlatformColor("systemPurple")

systemRedColorValue

PlatformColor("systemRed")

systemTealColorValue

PlatformColor("systemTeal")

systemYellowColorValue

PlatformColor("systemYellow")

tertiaryLabelColorValue

PlatformColor("tertiaryLabel")

tertiarySystemBackgroundColorValue

PlatformColor("tertiarySystemBackground")

tertiarySystemFillColorValue

PlatformColor("tertiarySystemFill")

tertiarySystemGroupedBackgroundColorValue

PlatformColor("tertiarySystemGroupedBackground")

StackHeaderItemSharedProps

Android
iOS
tvOS
Web
PropertyTypeDescription
accessibilityHint(optional)string
-
accessibilityLabel(optional)string
-
children(optional)ReactNode
-
disabled(optional)boolean
-
hidesSharedBackground(optional)boolean
-
icon(optional)ImageSourcePropType | SFSymbols7_0
-
separateBackground(optional)boolean
-
style(optional)StyleProp<BasicTextStyle>
-
tintColor(optional)ColorValue
-
variant(optional)'done' | 'prominent' | 'plain'
Default:'plain'

UsePreventZoomTransitionDismissalOptions

Android
iOS
tvOS
Web
PropertyTypeDescription
unstable_dismissalBoundsRect(optional)DismissalBoundsRect

Defines the screen bounds where interactive dismissal gestures are allowed.

Each coordinate is optional. Undefined coordinates place no restriction on that dimension. For example, if only minY and maxY are defined, horizontal gestures are unrestricted while vertical gestures must stay within the Y bounds.

See: Apple documentation for more information.

Types

AndroidDynamicMaterialColor

Android
iOS
tvOS
Web

Type: AndroidDynamicMaterialColorType extended by:

PropertyTypeDescription

AndroidMaterialColor

Android
iOS
tvOS
Web

Type: AndroidStaticMaterialColorType extended by:

PropertyTypeDescription

EffectCallback()

Android
iOS
tvOS
Web

Memoized callback containing the effect, should optionally return a cleanup function.

Returns:

undefined | void | () => void

ExternalPathString

Android
iOS
tvOS
Web

Literal Type: union

Acceptable values are: {string}:{string} | //{string}

Href<T>

Android
iOS
tvOS
Web

The main routing type for Expo Router. It includes all available routes with strongly typed parameters. It can either be:

  • string: A full path like /profile/settings or a relative path like ../settings.
  • object: An object with a pathname and optional params. The pathname can be a full path like /profile/settings or a relative path like ../settings. The params can be an object of key-value pairs.

An Href can either be a string or an object.

Generic: T

Type: T ? T[href] : string | HrefObject

HrefObject

Android
iOS
tvOS
Web
PropertyTypeDescription
params(optional)UnknownInputParams

Optional parameters for the route.

pathnamestring

The path of the route.

NativeIntent

Android
iOS
tvOS
Web

Created by using a special file called +native-intent.tsx at the top-level of your project's app directory. It exports redirectSystemPath or legacy_subscribe functions, both methods designed to handle URL/path processing.

Useful for re-writing URLs to correctly target a route when unique/referred URLs are incoming from third-party providers or stale URLs from previous versions.

See: For more information on how to use NativeIntent, see Customizing links.

PropertyTypeDescription
legacy_subscribe(optional)(listener: (url: string) => void) => undefined | void | () => void
Experimentally available in SDK 52.

Useful as an alternative API when a third-party provider doesn't support Expo Router but has support for React Navigation via Linking.subscribe() for existing projects.

Using this API is not recommended for newer projects or integrations since it is incompatible with Server Side Routing and Static Rendering, and can become challenging to manage while offline or in a low network environment.

redirectSystemPath(optional)(event: { initial: boolean, path: string }) => Promise<string | null> | string | null

A special method used to process URLs in native apps. When invoked, it receives an options object with the following properties:

  • path: represents the URL or path undergoing processing.
  • initial: a boolean indicating whether the path is the app's initial URL.

Its return value should be a string, a Promise<string | null>, or null. When a falsy value is returned (for example, null), no redirection occurs and the app stays on the current path.

Note that throwing errors within this method may result in app crashes. It's recommended to wrap your code inside a try/catch block and utilize .catch() when appropriate.

See: For usage information, see Redirecting system paths.

PickPartial

Android
iOS
tvOS
Web

Literal Type: union

The list of input keys will become optional, everything else will remain the same.

Acceptable values are: Omit<T, K> | Partial<Pick<T, K>>

RedirectConfig

Android
iOS
tvOS
Web
PropertyTypeDescription
destinationstring
-
destinationContextKeystring
-
external(optional)boolean
-
methods(optional)string[]
-
permanent(optional)boolean
-
sourcestring
-

RelativePathString

Android
iOS
tvOS
Web

Literal Type: union

Acceptable values are: ./{string} | ../{string} | '..'

ResultState

Android
iOS
tvOS
Web

Type: PartialState<NavigationState> extended by:

PropertyTypeDescription
state(optional)ResultState
-

Route

Android
iOS
tvOS
Web

Type: Exclude<Extract[pathname], RelativePathString | ExternalPathString>

Router

Android
iOS
tvOS
Web

Returns router object for imperative navigation API.

Example

import { router } from 'expo-router'; import { Text } from 'react-native'; export default function Route() { return ( <Text onPress={() => router.push('/home')}>Go Home</Text> ); }
PropertyTypeDescription
back() => void

Goes back in the navigation history.

canDismiss() => boolean

Checks if it is possible to dismiss the current screen. Returns true if the router is within the stack with more than one screen in stack's history.

canGoBack() => boolean

Navigates to a route in the navigator's history if it supports invoking the back function.

dismiss(count: number) => void

Navigates to the a stack lower than the current screen using the provided count if possible, otherwise 1.

If the current screen is the only route, it will dismiss the entire stack.

dismissAll() => void

Returns to the first screen in the closest stack. This is similar to popToTop stack action.

dismissTo(href: Href, options: NavigationOptions) => void

Dismisses screens until the provided href is reached. If the href is not found, it will instead replace the current screen with the provided href.

navigate(href: Href, options: NavigationOptions) => void

Navigates to the provided href.

prefetch(name: Href) => void

Prefetch a screen in the background before navigating to it

push(href: Href, options: NavigationOptions) => void

Navigates to the provided href using a push operation if possible.

replace(href: Href, options: NavigationOptions) => void

Navigates to route without appending to the history. Can be used with useFocusEffect to redirect imperatively to a new screen.

See: Using useRouter() hook to redirect.

setParams(params: Partial<RouteInputParams<T>>) => void

Updates the current route's query params.

ScreenProps

Android
iOS
tvOS
Web
PropertyTypeDescription
dangerouslySingular(optional)SingularOptions
-
getId(optional)({ params }: { params: Record<string, any> }) => string | undefined
-
initialParams(optional)Record<string, any>
-
listeners(optional)ScreenListeners<TState, TEventMap> | (prop: { navigation: any, route: RouteProp<ParamListBase, string> }) => ScreenListeners<TState, TEventMap>
-
name(optional)string

Name is required when used inside a Layout component.

options(optional)TOptions | (prop: { navigation: any, route: RouteProp<ParamListBase, string> }) => TOptions
-
redirect(optional)boolean

Redirect to the nearest sibling route. If all children are redirect={true}, the layout will render null as there are no children to render.

SearchOrHash

Android
iOS
tvOS
Web

Literal Type: union

Acceptable values are: ?{string} | #{string}

SingularOptions

Android
iOS
tvOS
Web

Type: boolean or object shaped as below:

(name, params) => string | undefined

ParameterTypeDescription
name(index signature)string
-
params(index signature)UnknownOutputParams
-

SitemapType

Android
iOS
tvOS
Web
PropertyTypeDescription
childrenSitemapType[]
-
contextKeystring
-
filenamestring
-
hrefstring | Href
-
isGeneratedboolean
-
isInitialboolean
-
isInternalboolean
-

WebAnchorProps

Web
PropertyTypeDescription
download(optional)string

Specifies that the href should be downloaded when the user clicks on the link, instead of navigating to it. It is typically used for links that point to files that the user should download, such as PDFs, images, documents, and more.

The value of the download property, which represents the filename for the downloaded file. This property is passed to the underlying anchor (<a>) tag.

Example

<Link href="/image.jpg" download="my-image.jpg">Download image</Link>
rel(optional)string

Specifies the relationship between the href and the current route.

Common values:

  • nofollow: Indicates to search engines that they should not follow the href. This is often used for user-generated content or links that should not influence search engine rankings.
  • noopener: Suggests that the href should not have access to the opening window's window.opener object, which is a security measure to prevent potentially harmful behavior in cases of links that open new tabs or windows.
  • noreferrer: Requests that the browser does not send the Referer HTTP header when navigating to the href. This can enhance user privacy.

The rel property is primarily used for informational and instructive purposes, helping browsers and web crawlers make better decisions about how to handle and interpret the links on a web page. It is important to use appropriate rel values to ensure that links behave as intended and adhere to best practices for web development and SEO (Search Engine Optimization).

This property is passed to the underlying anchor (<a>) tag.

Example

<Link href="https://expo.dev" rel="nofollow">Go to Expo</Link>
target(optional)'_self' | '_blank' | '_parent' | '_top' | string & object

Specifies where to open the href.

  • _self: the current tab.
  • _blank: opens in a new tab or window.
  • _parent: opens in the parent browsing context. If no parent, defaults to _self.
  • _top: opens in the highest browsing context ancestor. If no ancestors, defaults to _self.

This property is passed to the underlying anchor (<a>) tag.

Default:'_self'

Example

<Link href="https://expo.dev" target="_blank">Go to Expo in new tab</Link>