Client-Side Routing

A router maps URLs to application views without requiring a full document reload for every navigation. Modern routing systems can support nested layouts, route parameters, data loading, redirects, error boundaries, and code splitting.

Routes should reflect user-facing information architecture rather than component filenames. A route such as /projects/:projectId/settings communicates a resource relationship.

Navigation should remain accessible: use real links for navigation, preserve browser history semantics, and avoid replacing links with clickable generic elements.

Semantic navigation
<nav aria-label="Primary">
  <a href="/dashboard">Dashboard</a>
  <a href="/projects">Projects</a>
</nav>

Router-specific link components can improve client-side navigation while preserving the semantics of an anchor.

Key Takeaways
  • URLs are part of application state and information architecture.

  • Use semantic links for navigation.

  • Choose route boundaries around user-facing resources and flows.