PACKAGE · ROUTING

@remix-run/router

Nested/Data-driven/Framework-agnostic Routing

WEEKLY DOWNLOADS 22.3M
STARS 56.6K
FORKS 10.9K
OPEN ISSUES 212
GZIP SIZE 20.4 kB
UNPACKED SIZE 2.8 MB
DEPENDENCIES 1
LAST UPDATED 7mo ago
DOWNLOAD TRENDS

@remix-run/router downloads · last 12 months

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

@remix-run/router provides a powerful, framework-agnostic routing solution designed to handle complex application navigation. It tackles the challenge of managing application state and UI synchronization across different routes, particularly in single-page applications where traditional page reloads are undesirable. The library enables declarative route definitions and handles transitions, data loading, and error management efficiently.

Its core philosophy centers around data-driven routing, where routes are not just UI components but also responsible for fetching and managing their associated data. This approach simplifies data fetching logic and ensures that UI is always synchronized with the current route's data requirements. It's primarily built for developers building dynamic, data-intensive web applications, especially those leveraging modern JavaScript frameworks.

The API is built around concepts like route objects, `useNavigate`, `useParams`, and `useLoaderData`. Nested routing is a fundamental pattern, allowing routes to be organized hierarchically, which directly maps to UI composition. This enables features like layout routes and parallel data loading, managed through its history and navigation APIs.

While framework-agnostic, @remix-run/router is the foundational routing library for Remix and can be integrated into other React applications. Its history management and navigation logic can be plugged into various client-side rendering setups. Developers can leverage its core routing capabilities outside of the full Remix framework.

With weekly downloads exceeding 14.9 million and 56.6K GitHub stars, it represents a mature and widely adopted solution in the routing space. The unpacked size of 2.8 MB and a gzipped bundle size of 20.4 kB indicate a relatively lean footprint for its feature set, making it suitable for performance-sensitive applications.

One limitation to consider is that its data-driven approach, while powerful, may introduce a steeper learning curve for developers accustomed to simpler client-side routing patterns. The full benefit is realized when integrating its data loading and error handling paradigms into your application architecture.

WHEN TO USE
  • When building applications that require deeply nested UI structures that map directly to URL segments, utilizing nested routes and layout components.
  • When you need to manage asynchronous data loading for different route segments and ensure the UI is updated accordingly, using `useLoaderData`.
  • For applications that require robust error handling and fallbacks for data fetching failures within specific route boundaries.
  • When developing a framework-agnostic routing layer that can be integrated into various JavaScript applications, not limited to a specific UI library.
  • To implement declarative navigation between different application states and access route parameters using `useNavigate` and `useParams`.
  • When building applications that benefit from prefetching route data to improve perceived performance during navigation.
WHEN NOT TO USE
  • If your primary need is simple client-side URL matching and history manipulation for a small, static website — a lighter-weight router might suffice.
  • When your application does not involve dynamic data fetching tied to specific routes, making the data-loading features redundant.
  • If you prefer a routing solution with a minimal API surface and fewer concepts related to data loading and error management.
  • When integrating into environments that strictly require server-side rendering without a clear path to leverage the library's data loading lifecycle.
  • If you are building a non-React application and require a routing solution specifically tailored to that framework's ecosystem.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
@remix-run/router vs react-router ★ 56.6K · 56.3M/wk @remix-run/router vs @tanstack/react-router ★ 15.1K · 23.1M/wk @remix-run/router vs wouter ★ 7.9K · 1.9M/wk