PACKAGE · ROUTING

@remix-run/router

Nested/Data-driven/Framework-agnostic Routing

WEEKLY DOWNLOADS 12.3M
STARS 56.4K
FORKS 10.9K
OPEN ISSUES 137
GZIP SIZE 20.7 kB
UNPACKED SIZE 2.8 MB
DEPENDENCIES 1
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

@remix-run/router downloads — last 12 months

Download trends for @remix-run/router1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.031.8M63.7M95.5M127.3MJun 2025SepDecMarMay 2026
@remix-run/router
ABOUT @REMIX-RUN/ROUTER

@remix-run/router provides framework-agnostic routing capabilities, designed to solve the complexities of managing navigation, nested layouts, and data loading in modern web applications. It abstracts away the browser's History API and URL parsing, offering a predictable and declarative way to define application routes and their associated data fetching and rendering logic.

The core philosophy centers around data-driven routing, where routes are inherently linked to the data they need to display. This approach simplifies state management and enhances user experience by enabling features like automatic data revalidation and optimistic UI updates. It's primarily built for developers working with React, aiming to be a foundational piece for frameworks like Remix and others.

Key API patterns include its hierarchical route definition, which allows for deeply nested layouts and UI composition. Mechanisms like `useLoaderData`, `useActionData`, and `useFetcher` expose route data and state directly within React components, promoting a tight coupling between the routing layer and the UI. This enables seamless data fetching before rendering and handling form submissions or mutations.

While framework-agnostic in its routing engine, @remix-run/router shines when integrated into React applications. It serves as the routing foundation for the Remix framework, leveraging its features for server-side rendering and data loading. Its design also accommodates integration with other React-based meta-frameworks or custom setups seeking advanced routing patterns.

With 23.7M weekly downloads and 56.4K GitHub stars, the package demonstrates significant adoption and community trust. Its unpacked size of 2.8 MB and a gzipped bundle size of 20.7 kB indicate a relatively lean footprint for its extensive capabilities. The last update reported as 2026-05-30 suggests ongoing development and maintenance, although the year seems to be a placeholder.

A notable aspect is its declarative approach to route matching and data loading, which minimizes manual state management. However, developers should be aware of its specific data loading patterns. Errors during data loading can prevent route rendering, requiring careful error handling within loader functions to ensure application stability. The dependency on a specific data-fetching paradigm might require adjustments for teams accustomed to different data management strategies.

WHEN TO USE
  • When implementing nested routing structures that mirror your UI components, utilizing the hierarchical route definition.
  • For applications requiring automatic data fetching tied to route transitions, using `useLoaderData` to access pre-loaded data.
  • When building server-rendered React applications where route-level data loading is critical for TTFB, integrating with rendering frameworks.
  • For handling form submissions and data mutations declaratively, leveraging `useFetcher` to manage background updates.
  • When aiming for a component-centric routing model where routes are defined alongside their corresponding UI components.
  • In scenarios demanding automatic data revalidation upon navigation or mutations to keep the UI fresh, powered by its built-in invalidation mechanisms.
  • For applications that benefit from automatic code splitting based on route definitions, improving initial load performance.
WHEN NOT TO USE
  • If your application requires only basic client-side navigation without complex data dependencies or nested layouts; a simpler routing solution might suffice.
  • When you prefer a JavaScript-first approach to data fetching and state management outside of the routing layer; this package tightly couples data loading to routes.
  • If your project mandates strict separation of routing logic from data fetching concerns; @remix-run/router's core paradigm is data-driven routing.
  • For static site generators that pre-render all routes and do not require dynamic data loading at runtime; a simpler static routing configuration would be more appropriate.
  • When building non-React applications or environments where React integration is not feasible; this package is designed with React's component model in mind.
  • If you need a routing solution that doesn't involve nested layouts or hierarchical route matching needs; simpler URL-to-component mappings may be adequate.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
@remix-run/router vs wouter ★ 7.8K · 1.0M/wk @remix-run/router vs @tanstack/react-router ★ 14.6K · 9.5M/wk @remix-run/router vs react-router ★ 56.4K · 23.8M/wk