Skip to main content

Overview

reatomRoute creates a reactive route atom that automatically syncs with the browser URL. Routes provide:
  • URL pattern matching with parameters
  • Type-safe navigation
  • Schema validation for parameters
  • Async data loading with automatic abort
  • Component rendering with outlet composition
  • Hierarchical route nesting

Type Signature

Parameters

string | RouteOptions
required
Either a path pattern string (e.g., 'users/:userId') or a configuration object
string
Debug name for the route atom

Return Value

RouteAtom<Path, ParamsOutput, SearchOutput>
Route atom that returns validated params when matched, or null when not matched.

Examples

Basic Routes

Optional Parameters

Nested Routes

Parameter Validation

Search Parameters

Data Loading

Nested Loaders

Search-Only Routes

Component Rendering

Exact Rendering

Callback-Based Params

404 Detection

Loader Pending State

Type Utilities

PathParams

Extract parameter types from a path pattern: