Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
remix-run avatar

React Router Declarative Mode

  • 567 installs
  • 138 repo stars
  • Updated June 18, 2026
  • remix-run/agent-skills

react-router-declarative-mode is a Claude Code skill that generates correct React Router v6.4+ JSX route declarations, navigation components, and URL value hooks without data loaders for developers who need BrowserRouter

About

react-router-declarative-mode is a Remix-run agent skill for React Router's declarative mode using BrowserRouter, Routes, Route, Link, NavLink, useNavigate, and URL param hooks. The skill steers agents away from loaders, actions, and data-router APIs so generated code matches the simplest React Router v6.4+ pattern for SPAs. Developers reach for react-router-declarative-mode when scaffolding or refactoring route trees, active navigation, and query or path param reads in React apps that do not need server-driven data loading. It is MIT-licensed and ships from remix-run/agent-skills as a focused routing reference for JSX-first React projects.

  • Generates declarative <BrowserRouter>, <Routes>, and <Route> configurations
  • Produces Link, NavLink, and useNavigate patterns with correct active states
  • Handles useParams, useSearchParams, and useLocation hooks accurately
  • Loads targeted reference files: routing.md, navigation.md, url-values.md
  • Enforces React Router declarative mode without Remix data APIs

React Router Declarative Mode by the numbers

  • 567 all-time installs (skills.sh)
  • +16 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #589 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/remix-run/agent-skills --skill react-router-declarative-mode

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs567
repo stars138
Last updatedJune 18, 2026
Repositoryremix-run/agent-skills

How do you set up React Router declarative routes?

Generate correct React Router v6.4+ JSX route declarations, navigation components, and URL value hooks without data loaders.

Who is it for?

React developers building SPAs with React Router v6.4+ declarative mode who want JSX routes and navigation without data loaders.

Skip if: Teams using React Router data routers with loaders, actions, or framework-mode routing should skip this skill.

When should I use this skill?

The user configures BrowserRouter routes, Link or NavLink navigation, or URL param hooks without React Router loaders or actions.

What you get

JSX route trees, Link and NavLink navigation, useNavigate calls, and useParams or useSearchParams hook usage without loaders or actions.

  • JSX route configuration
  • navigation components
  • URL param hook usage

Files

SKILL.mdMarkdownGitHub ↗

React Router Declarative Mode

Declarative mode is React Router's simplest mode using <BrowserRouter>, <Routes>, and <Route> for basic client-side routing without data loading features like loaders or actions.

When to Apply

  • Using <BrowserRouter> for routing
  • Configuring routes with <Routes> and <Route>
  • Navigating with <Link>, <NavLink>, or useNavigate
  • Reading URL params with useParams
  • Working with search params using useSearchParams
  • Accessing location with useLocation

References

Load the relevant reference for detailed guidance on the specific API/concept:

ReferenceUse When
references/routing.mdConfiguring routes, nested routes, dynamic params
references/navigation.mdLinks, NavLink active states, programmatic nav
references/url-values.mdReading params, search params, location

Critical Patterns

These are the most important patterns to follow. Load the relevant reference for full details.

Basic Route Setup

Configure routes with JSX using <Routes> and <Route>:

import { BrowserRouter, Routes, Route } from "react-router";

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="about" element={<About />} />
        <Route path="dashboard" element={<Dashboard />}>
          <Route index element={<DashboardHome />} />
          <Route path="settings" element={<Settings />} />
        </Route>
        <Route path="users/:userId" element={<User />} />
      </Routes>
    </BrowserRouter>
  );
}

NavLink Active States

Use NavLink for navigation with active styling:

import { NavLink } from "react-router";

function Nav() {
  return (
    <nav>
      <NavLink
        to="/"
        end
        className={({ isActive }) => (isActive ? "active" : "")}
      >
        Home
      </NavLink>
      <NavLink
        to="/dashboard"
        className={({ isActive }) => (isActive ? "active" : "")}
      >
        Dashboard
      </NavLink>
    </nav>
  );
}

Reading URL Params

Use useParams to read dynamic route segments:

import { useParams } from "react-router";

function User() {
  const { userId } = useParams();
  return <h1>User {userId}</h1>;
}

Working with Search Params

Use useSearchParams for query string values:

import { useSearchParams } from "react-router";

function SearchResults() {
  const [searchParams, setSearchParams] = useSearchParams();
  const query = searchParams.get("q");

  return (
    <div>
      <input
        value={query || ""}
        onChange={(e) => setSearchParams({ q: e.target.value })}
      />
      <p>Results for: {query}</p>
    </div>
  );
}

Further Documentation

If anything related to React Router is not covered in these references, you can search the official documentation:

https://reactrouter.com/docs

Related skills

How it compares

Pick react-router-declarative-mode for JSX-only SPA routing; choose data-router skills when loaders, actions, or server-driven routes are required.

FAQ

What React Router version does react-router-declarative-mode target?

react-router-declarative-mode targets React Router v6.4+ declarative mode with BrowserRouter, Routes, Route, Link, NavLink, and URL hooks. The skill explicitly avoids loaders, actions, and data-router APIs for simpler SPA routing.

Does react-router-declarative-mode cover React Router data loaders?

react-router-declarative-mode does not cover loaders or actions. The skill focuses on declarative JSX routing, Link and NavLink navigation, and URL param hooks for client-side SPAs without data loading features.

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.