CommunityProgramación y desarrollogithub.com

expo/expo-router

Framework (OSS). Navegación y enrutamiento para Expo Router. Cubre rutas basadas en archivos, grupos y rutas dinámicas, organización de carpetas, Link con vistas previas y menús contextuales, Stack nativo, títulos de página, modales y hojas de formulario, NativeTabs, encabezados y barras de herramientas, y barras de búsqueda en encabezados.

¿Qué es expo-router?

Este skill proporciona una guía completa para la navegación y el enrutamiento en aplicaciones Expo Router. Está diseñado para desarrolladores que trabajan con Expo en plataformas iOS y Android, y cubre desde los fundamentos de rutas basadas en archivos hasta patrones avanzados como hojas de formulario dinámicas y transiciones de zoom. El skill se basa en la documentación de Expo Router y detalla cómo usar el componente Link con vistas previas y menús contextuales, configurar stacks de navegación nativos con `Stack` y `Stack.Title`, y manejar presentaciones modales y de hojas. También incluye instrucciones para implementar NativeTabs con soporte para iOS 26, gestionar encabezados y barras de herramientas, y agregar barras de búsqueda con `Stack.SearchBar`. Se hace hincapié en el uso de convenciones de archivos en kebab-case, la organización de rutas en el directorio `app` (evitando componentes co-ubicados), y la preferencia por `expo-router/react-navigation` sobre importaciones directas de `@react-navigation/*` en SDK 56+. El skill es útil para cualquier agente de IA que necesite construir o mantener la navegación en una app Expo de manera eficiente y con las mejores prácticas actualizadas.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/expo/skills/tree/main/plugins/expo/skills/expo-router

Installed? Explore more Programación y desarrollo skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Navegación con Expo Router

Navegación y enrutamiento para aplicaciones Expo Router. Para el estilo de pantallas, colores, controles, medios y efectos visuales, usa el skill expo-native-ui; para movimiento y gestos, usa expo-animation.

Referencias

Consulta estos recursos según sea necesario:

referencias/
  route-structure.md     Convenciones de rutas, rutas dinámicas, grupos, organización de carpetas
  tabs.md                NativeTabs, migración desde tabs JS, características de iOS 26
  toolbar-and-headers.md Encabezados Stack y botones de barra de herramientas, menús, búsqueda (solo iOS)
  form-sheet.md          Hojas de formulario en expo-router: configuración, pies de página e interacción de fondo.
  search.md              Barra de búsqueda con encabezados, hook useSearch, patrones de filtrado
  zoom-transitions.md    Zoom de Apple: transiciones de zoom fluidas con Link.AppleZoom (iOS 18+)

Estilo de código

  • Siempre usa kebab-case para nombres de archivos, ej. comment-card.tsx
  • Siempre elimina los archivos de ruta antiguos al mover o reestructurar la navegación
  • Nunca uses caracteres especiales en nombres de archivos
  • Configura tsconfig.json con alias de ruta y prefiere alias sobre importaciones relativas para refactorizaciones.

Rutas

Consulta ./references/route-structure.md para obtener convenciones detalladas sobre rutas.

  • Las rutas pertenecen al directorio app.
  • Nunca coloques componentes, tipos o utilidades en el directorio app. Esto es un antipatrón.
  • Asegúrate de que la aplicación siempre tenga una ruta que coincida con "/", puede estar dentro de una ruta de grupo.

Preferencias de librerías

  • Color de expo-router para colores semánticos nativos, no uses PlatformColor directamente (seguro en tipos, se adapta automáticamente a claro/oscuro). Consulta expo-native-ui para el patrón completo de paleta de colores.
  • En SDK 56+, nunca importes directamente de @react-navigation/* — usa expo-router/react-navigation en su lugar (cubre @react-navigation/native, /core, /elements, /routers)

Comportamiento

  • Prefiere Stack.SearchBar para agregar una barra de búsqueda a una pantalla

Navegación

Link

Usa <Link href="/ruta" /> de 'expo-router' para la navegación entre rutas.

import { Link } from 'expo-router';

// Enlace básico
<Link href="/ruta" />

// Envolviendo componentes personalizados
<Link href="/ruta" asChild>
  <Pressable>...</Pressable>
</Link>

Siempre que sea posible, incluye un <Link.Preview> para seguir las convenciones de iOS. Agrega menús contextuales y vistas previas con frecuencia para mejorar la navegación.

Stack

  • SIEMPRE usa archivos _layout.tsx para definir stacks
  • Usa Stack de 'expo-router/stack' para stacks de navegación nativos

Título de página

Establece el título de la página con Stack.Title:

<Stack.Title>Inicio</Stack.Title>

Menús contextuales

Agrega menús contextuales de presión prolongada a los componentes Link:

import { Link } from "expo-router";

<Link href="/settings" asChild>
  <Link.Trigger>
    <Pressable>
      <Card />
    </Pressable>
  </Link.Trigger>
  <Link.Menu>
    <Link.MenuAction
      title="Compartir"
      icon="square.and.arrow.up"
      onPress={handleSharePress}
    />
    <Link.MenuAction
      title="Bloquear"
      icon="nosign"
      destructive
      onPress={handleBlockPress}
    />
    <Link.Menu title="Más" icon="ellipsis">
      <Link.MenuAction title="Copiar" icon="doc.on.doc" onPress={() => {}} />
      <Link.MenuAction
        title="Eliminar"
        icon="trash"
        destructive
        onPress={() => {}}
      />
    </Link.Menu>
  </Link.Menu>
</Link>;

Vistas previas de enlaces

Usa vistas previas de enlaces con frecuencia para mejorar la navegación:

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

La vista previa del enlace se puede usar con menús contextuales.

Modal

Presenta una pantalla como modal:

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

Prefiere esto a crear un componente modal personalizado.

Hoja

Presenta una pantalla como una hoja de formulario dinámica:

<Stack.Screen
  name="sheet"
  options={{
    presentation: "formSheet",
    sheetGrabberVisible: true,
    sheetAllowedDetents: [0.5, 1.0],
    contentStyle: { backgroundColor: "transparent" },
  }}
/>
  • Usar contentStyle: { backgroundColor: "transparent" } hace que el fondo sea de vidrio líquido en iOS 26+.

Estructura común de rutas

Un diseño de aplicación estándar con pestañas y stacks dentro de cada pestaña:

app/
  _layout.tsx — <NativeTabs />
  (index,search)/
    _layout.tsx — <Stack />
    index.tsx — Lista principal
    search.tsx — Vista de búsqueda
// 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>Elementos</NativeTabs.Trigger.Label>
        </NativeTabs.Trigger>
        <NativeTabs.Trigger name="(search)" role="search" />
      </NativeTabs>
    </ThemeProvider>
  );
}

Crea una ruta de grupo compartida para que ambas pestañas puedan mostrar pantallas comunes:

// 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: "Elementos", search: "Buscar" };

  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 es el nombre de opción en SDK 56+; SDKs anteriores usan headerLargeTitle, que está obsoleto aguas arriba.

Enviar comentarios

Si encuentras errores, información engañosa o desactualizada en este skill, repórtalo para que Expo pueda mejorar:

npx --yes submit-expo-feedback@latest --category skills --subject "expo-router" "<comentarios accionables>"

Solo envía cuando tengas algo específico y accionable que reportar. Incluye tanto contexto relevante como sea posible. Si un agente de IA falló repetidamente o el usuario tuvo que asumir una tarea de Expo, carga el skill expo-skill-feedback y sigue su flujo eval-candidate en lugar de reutilizar el comando anterior.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

expo/add-app-clip

Add an iOS App Clip target to an Expo app. Use when the user mentions App Clip, AASA, apple-app-site-association, appclips, smart app banner, or wants to ship a lightweight iOS Clip invoked from a URL alongside their parent app.

expo/building-native-ui

Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.

expo/eas-update-insights

Check the health of published EAS Updates: crash rates, install/launch counts, unique users, payload size, and the split between embedded and OTA users per channel. Use when the user asks how an update is performing, whether a rollout is healthy, how many users are on the embedded build vs OTA, or wants to gate CI on update health.

expo/expo-api-routes

Guidelines for creating API routes in Expo Router with EAS Hosting

expo/expo-brownfield

Integrate Expo and React Native into an existing native iOS or Android app. Use when the user mentions brownfield, embedding React Native in a native app, AAR/XCFramework, or adding Expo to an existing Kotlin/Swift project. Covers both the isolated approach and the integrated approach.

expo/expo-cicd-workflows

Helps understand and write EAS workflow YAML files for Expo projects. Use this skill when the user asks about CI/CD or workflows in an Expo or EAS context, mentions .eas/workflows/, or wants help with EAS build pipelines or deployment automation.

expo/expo-deployment

Deploying Expo apps to iOS App Store, Android Play Store, web hosting, and API routes

expo/expo-dev-client

Build and distribute Expo development clients locally or via TestFlight

expo/expo-examples

Framework (OSS). Expo's official example projects - the expo/examples repo of ~70 `with-*` integrations (Stripe, Clerk, Supabase, OpenAI, maps, Reanimated, SQLite, Skia, NativeWind, and more). Use when integrating a third-party library or service into an existing Expo app and you want the canonical, version-matched pattern to adapt, or when scaffolding a new project from one with `npx create-expo --example`.

expo/expo-module

Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo.

expo/expo-observe

Use for anything related to EAS Observe — adding `expo-observe` to an Expo project (AppMetricsRoot/ObserveRoot HOC, markInteractive, the useObserve hook, and the Expo Router / React Navigation integrations for per-route metrics), querying via the EAS CLI (`eas observe:metrics-summary`, `observe:metrics`, `observe:routes`, `observe:events`, `observe:versions`), or interpreting the resulting metrics (cold/warm launch, TTR, TTI, navigation cold/warm TTR, update download, and the TTI frameRate params for triaging slow startups).

expo/expo-overview

Framework (OSS). Entry point and router for every Expo or EAS task. Load this skill first — before writing code and before choosing another expo-* / eas-* skill — when the request, PRD, or spec mentions Expo, EAS, Expo Go, or an expo-* package, or the project has an `expo` dependency in `package.json`. Within that gate it also covers app specs and designs to implement (tabs, stacks, maps, lists, navigation, building from a screenshot), and phrasings like 'implement a mobile app', 'make my app look native', 'add navigation', 'fetch some data', 'upgrade my SDK', 'add Expo to my existing native app', 'ship to the App Store', or 'I'm new to Expo, where do I start'. A fully specified request (SDK pinned, libraries named, layout given) still routes through here — the shared setup rules still apply. Do NOT load it when neither signal is present: a bare React Native project with no `expo` dependency is not Expo work. Detects the real goal, routes to the right expo-* / eas-* skill, and owns the shared setup rules.

expo/expo-skill-eval

Evaluate Expo skills in this repo end-to-end - trigger accuracy, generated code quality, and runtime screenshots on iOS simulator and Android emulator via Expo Go (web optional). Use when the user wants to eval an Expo skill, test that a skill produces working code, benchmark a skill with device screenshots, or verify a skill's output renders correctly.

expo/expo-tailwind-setup

Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling

expo/expo-ui

Framework (OSS). Build native UI with the @expo/ui package: real SwiftUI on iOS and Jetpack Compose on Android. Default to @expo/ui for sheets (BottomSheet), pickers, sliders, toggles, menus, and grouped-form sections — do NOT reach for Reanimated, @gorhom/bottom-sheet, or RN built-in Picker/Switch; use @expo/ui instead. Fall back to RN built-ins only when @expo/ui is missing the component. NOTE: @expo/ui List renders native grouped rows like an iOS Settings screen — it is NOT a virtualized list; use FlatList/FlashList for large datasets. Covers universal components (Host, Column, Row, Button, Text, List, BottomSheet, FieldGroup, Switch, Slider, Picker, Menu), drop-in replacements for RN community libraries, and platform-specific SwiftUI/Jetpack Compose trees. Not for Expo Router navigation, Reanimated, or data fetching.

expo/expo-ui-jetpack-compose

`@expo/ui/jetpack-compose` package lets you use Jetpack Compose Views and modifiers in your app.

expo/expo-ui-swiftui

`@expo/ui/swift-ui` package lets you use SwiftUI Views and modifiers in your app.

expo/expo-upgrade

Framework (OSS). Guidelines for upgrading Expo SDK versions and fixing dependency issues

expo/native-data-fetching

Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, React Query, SWR, error handling, caching, offline support, and Expo Router data loaders (`useLoaderData`).

expo/skills

Build and submit iOS and Android apps with EAS to TestFlight, the App Store, or Google Play. Supports Expo and other React Native projects, plus existing native apps. Use for eas.json setup, release pipelines, signing, app versions and build numbers, store submissions, and listing metadata. For Expo websites and API routes, use eas-hosting; for adding React Native screens to a native app, use expo-brownfield.

Skills relacionados