Expo Router navigation

Applies Expo Router conventions: file-based routes in app/, native Stack, NativeTabs, Link previews and context menus, modals, form sheets, iOS toolbars and header search. Use when structuring navigation in an Expo Router app.

CodingPack: Expo skills239 linesexpo-router
Author
Source
expo/skills/plugins/expo/skills/expo-router @ 88d9bd7
License
MIT · Copyright (c) 2025-present 650 Industries, Inc. (aka Expo)

About this skill

What it does

The skill gives the agent Expo Router conventions and Expo's preferred native navigation pieces. Routes live only in app/, file names are kebab-case, components and utilities go elsewhere, some route must match /, and stacks are defined in _layout.tsx. For navigation it prefers Link with Link.Preview and long-press Link.Menu context menus, the native Stack with Stack.Title, modals and form sheets through presentation options, and Stack.SearchBar for search. A sample layout puts NativeTabs at the root and a shared (index,search) group stack under them, so two tabs can push the same screens. On SDK 56+ it forbids importing @react-navigation/* directly and points to expo-router/react-navigation.

Six reference files hold the detail:

  • route-structure.md: dynamic and catch-all routes, groups, array routes, not-found routes.
  • tabs.md: NativeTabs, SDK 54 and 55 syntax, iOS 26 liquid glass and minimize on scroll, migration from JS tabs, common issues.
  • toolbar-and-headers.md: header and bottom toolbars, iOS only, SDK 55+.
  • form-sheet.md: detents, footers, interaction with content behind the sheet.
  • search.md: search bar, useSearch, filtering.
  • zoom-transitions.md: Apple zoom transitions, iOS 18+, SDK 55+.

When to use it, and when not

Use it to lay out routes and add tabs, stacks, modals, sheets, headers or search in an Expo Router app. Much of it is iOS-specific (toolbars and zoom transitions work only on iOS), and NativeTabs still come from expo-router/unstable-native-tabs.

Styling and colors belong to Native-feeling Expo screens; motion goes to expo-animation, which is not in this catalog. Apps on plain React Navigation without Expo Router get little from it.

How to run it

The install command below puts the whole folder in place. The agent picks the skill up by its description when navigation comes up; to call it yourself:

  • Claude Code: /expo-router, or ask for the skill by name.
  • Codex: $expo-router.
  • Cursor: type / in the Agent chat and pick expo-router.

Example: /expo-router Add native tabs for Feed, Search and Profile, each with its own stack, plus a settings form sheet.

With Expo and EAS overview installed, the overview usually loads this skill for you.

How it differs from similar skills

React Native best practices from Vercel Labs has one navigation rule: native stacks and native tabs instead of JS navigators. Its examples import @react-navigation/native-stack directly, which this skill forbids on SDK 56+, so the two disagree on recent SDKs. Expo SDK upgrade touches navigation only as part of an upgrade: the SDK 55 changes to NativeTabs and, for SDK 56, a codemod that moves @react-navigation/* imports to expo-router entry points. Nothing else in the catalog covers mobile routing.

Install

Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.

Claude Code — macOS, Linux
curl -fsSL --create-dirs -o ~/.claude/skills/expo-router/SKILL.md https://anymodel.org/en/skills/expo/expo-router/SKILL.md -o ~/.claude/skills/expo-router/LICENSE https://anymodel.org/en/skills/expo/expo-router/LICENSE -o ~/.claude/skills/expo-router/agents/openai.yaml https://anymodel.org/en/skills/expo/expo-router/agents/openai.yaml -o ~/.claude/skills/expo-router/references/form-sheet.md https://anymodel.org/en/skills/expo/expo-router/references/form-sheet.md -o ~/.claude/skills/expo-router/references/route-structure.md https://anymodel.org/en/skills/expo/expo-router/references/route-structure.md -o ~/.claude/skills/expo-router/references/search.md https://anymodel.org/en/skills/expo/expo-router/references/search.md -o ~/.claude/skills/expo-router/references/tabs.md https://anymodel.org/en/skills/expo/expo-router/references/tabs.md -o ~/.claude/skills/expo-router/references/toolbar-and-headers.md https://anymodel.org/en/skills/expo/expo-router/references/toolbar-and-headers.md -o ~/.claude/skills/expo-router/references/zoom-transitions.md https://anymodel.org/en/skills/expo/expo-router/references/zoom-transitions.md
Codex, Cursor — macOS, Linux
curl -fsSL --create-dirs -o ~/.agents/skills/expo-router/SKILL.md https://anymodel.org/en/skills/expo/expo-router/SKILL.md -o ~/.agents/skills/expo-router/LICENSE https://anymodel.org/en/skills/expo/expo-router/LICENSE -o ~/.agents/skills/expo-router/agents/openai.yaml https://anymodel.org/en/skills/expo/expo-router/agents/openai.yaml -o ~/.agents/skills/expo-router/references/form-sheet.md https://anymodel.org/en/skills/expo/expo-router/references/form-sheet.md -o ~/.agents/skills/expo-router/references/route-structure.md https://anymodel.org/en/skills/expo/expo-router/references/route-structure.md -o ~/.agents/skills/expo-router/references/search.md https://anymodel.org/en/skills/expo/expo-router/references/search.md -o ~/.agents/skills/expo-router/references/tabs.md https://anymodel.org/en/skills/expo/expo-router/references/tabs.md -o ~/.agents/skills/expo-router/references/toolbar-and-headers.md https://anymodel.org/en/skills/expo/expo-router/references/toolbar-and-headers.md -o ~/.agents/skills/expo-router/references/zoom-transitions.md https://anymodel.org/en/skills/expo/expo-router/references/zoom-transitions.md
Claude Code — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','agents/openai.yaml','references/form-sheet.md','references/route-structure.md','references/search.md','references/tabs.md','references/toolbar-and-headers.md','references/zoom-transitions.md') { $p = Join-Path "$HOME\.claude\skills\expo-router" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/expo/expo-router/$f" -UseBasicParsing -OutFile $p }
Codex, Cursor — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','agents/openai.yaml','references/form-sheet.md','references/route-structure.md','references/search.md','references/tabs.md','references/toolbar-and-headers.md','references/zoom-transitions.md') { $p = Join-Path "$HOME\.agents\skills\expo-router" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/expo/expo-router/$f" -UseBasicParsing -OutFile $p }

Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/expo/expo-router/SKILL.md

SKILL.md

Raw

Expo Router Navigation

Navigation and routing for Expo Router apps. For screen styling, colors, controls, media, and visual effects, use the expo-native-ui skill; for motion and gestures, use expo-animation.

References

Consult these resources as needed:

references/
  route-structure.md     Route conventions, dynamic routes, groups, folder organization
  tabs.md                NativeTabs, migration from JS tabs, iOS 26 features
  toolbar-and-headers.md Stack headers and toolbar buttons, menus, search (iOS only)
  form-sheet.md          Form sheets in expo-router: configuration, footers and background interaction.
  search.md              Search bar with headers, useSearch hook, filtering patterns
  zoom-transitions.md    Apple Zoom: fluid zoom transitions with Link.AppleZoom (iOS 18+)

Code Style

  • Always use kebab-case for file names, e.g. comment-card.tsx
  • Always remove old route files when moving or restructuring navigation
  • Never use special characters in file names
  • Configure tsconfig.json with path aliases, and prefer aliases over relative imports for refactors.

Routes

See ./references/route-structure.md for detailed route conventions.

  • Routes belong in the app directory.
  • Never co-locate components, types, or utilities in the app directory. This is an anti-pattern.
  • Ensure the app always has a route that matches "/", it may be inside a group route.

Library Preferences

  • Color from expo-router for native semantic colors, not raw PlatformColor (type-safe, auto-adapts to light/dark). See expo-native-ui for the full color palette pattern.
  • In SDK 56+, never import from @react-navigation/* directly — use expo-router/react-navigation instead (covers @react-navigation/native, /core, /elements, /routers)

Behavior

  • Prefer Stack.SearchBar to add a search bar to a screen

Navigation

Use <Link href="/path" /> from 'expo-router' for navigation between routes.

import { Link } from 'expo-router';

// Basic link
<Link href="/path" />

// Wrapping custom components
<Link href="/path" asChild>
  <Pressable>...</Pressable>
</Link>

Whenever possible, include a <Link.Preview> to follow iOS conventions. Add context menus and previews frequently to enhance navigation.

Stack

  • ALWAYS use _layout.tsx files to define stacks
  • Use Stack from 'expo-router/stack' for native navigation stacks

Page Title

Set the page title with Stack.Title:

<Stack.Title>Home</Stack.Title>

Context Menus

Add long press context menus to Link components:

import { Link } from "expo-router";

<Link href="/settings" asChild>
  <Link.Trigger>
    <Pressable>
      <Card />
    </Pressable>
  </Link.Trigger>
  <Link.Menu>
    <Link.MenuAction
      title="Share"
      icon="square.and.arrow.up"
      onPress={handleSharePress}
    />
    <Link.MenuAction
      title="Block"
      icon="nosign"
      destructive
      onPress={handleBlockPress}
    />
    <Link.Menu title="More" icon="ellipsis">
      <Link.MenuAction title="Copy" icon="doc.on.doc" onPress={() => {}} />
      <Link.MenuAction
        title="Delete"
        icon="trash"
        destructive
        onPress={() => {}}
      />
    </Link.Menu>
  </Link.Menu>
</Link>;

Use link previews frequently to enhance navigation:

<Link href="/settings">
  <Link.Trigger>
    <Pressable>
      <Card />
    </Pressable>
  </Link.Trigger>
  <Link.Preview />
</Link>

Link preview can be used with context menus.

Modal

Present a screen as a modal:

<Stack.Screen name="modal" options={{ presentation: "modal" }} />

Prefer this to building a custom modal component.

Sheet

Present a screen as a dynamic form sheet:

<Stack.Screen
  name="sheet"
  options={{
    presentation: "formSheet",
    sheetGrabberVisible: true,
    sheetAllowedDetents: [0.5, 1.0],
    contentStyle: { backgroundColor: "transparent" },
  }}
/>
  • Using contentStyle: { backgroundColor: "transparent" } makes the background liquid glass on iOS 26+.

Common route structure

A standard app layout with tabs and stacks inside each tab:

app/
  _layout.tsx — <NativeTabs />
  (index,search)/
    _layout.tsx — <Stack />
    index.tsx — Main list
    search.tsx — Search view
// app/_layout.tsx
import { NativeTabs } from "expo-router/unstable-native-tabs";
import { ThemeProvider, DarkTheme, DefaultTheme } from "expo-router/react-navigation";
import { useColorScheme } from "react-native";

export default function Layout() {
  const colorScheme = useColorScheme();
  return (
    <ThemeProvider value={colorScheme === "dark" ? DarkTheme : DefaultTheme}>
      <NativeTabs>
        <NativeTabs.Trigger name="(index)">
          <NativeTabs.Trigger.Icon sf="list.dash" md="list" />
          <NativeTabs.Trigger.Label>Items</NativeTabs.Trigger.Label>
        </NativeTabs.Trigger>
        <NativeTabs.Trigger name="(search)" role="search" />
      </NativeTabs>
    </ThemeProvider>
  );
}

Create a shared group route so both tabs can push common screens:

// app/(index,search)/_layout.tsx
import { Stack } from "expo-router/stack";
import { colors } from "@/theme/colors";

export default function Layout({ segment }) {
  const screen = segment.match(/\((.*)\)/)?.[1]!;
  const titles: Record<string, string> = { index: "Items", search: "Search" };

  return (
    <Stack
      screenOptions={{
        headerTransparent: true,
        headerShadowVisible: false,
        headerLargeTitleShadowVisible: false,
        headerLargeStyle: { backgroundColor: "transparent" },
        headerTitleStyle: { color: colors.label },
        headerLargeTitleEnabled: true,
        headerBlurEffect: "none",
        headerBackButtonDisplayMode: "minimal",
      }}
    >
      <Stack.Screen name={screen} options={{ title: titles[screen] }} />
      <Stack.Screen name="i/[id]" options={{ headerLargeTitleEnabled: false }} />
    </Stack>
  );
}

headerLargeTitleEnabled is the SDK 56+ option name; older SDKs use headerLargeTitle, which is deprecated upstream.

Submitting Feedback

You can voluntarily report errors, misleading or outdated information in this skill, so Expo can improve it:

npx --yes @expo/agent-cli@latest feedback --category skills --subject "expo-router" --message "<actionable feedback>"

Use --category agent-cli for a problem with the agent CLI, and --category evals when an agent repeatedly fails at an Expo task. Run feedback --help for subjects and the data that the command sends. Each report goes to Expo with project and environment details. Show the user the message, and send it only if the user agrees. If you cannot ask the user, do not send it. Do not include secrets or personal data.

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack Expo skills