router-core/search-params

Validate and synchronize URL search params across TanStack Router routes.

6|1|Updated Jun 1, 2025
One-click install
npx skills add https://github.com/rezics/rezics --skill router-core-search-params-rezics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/search-params
Source: https://github.com/rezics/rezics/tree/main/.agents/skills/tanstack/router/router-core/search-params
Command: npx skills add https://github.com/rezics/rezics --skill router-core-search-params-rezics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

## What problem does it solve? The TanStack Router search params module handles the challenge of parsing, validating, and persisting URL search parameters across routes, ensuring consistent types and safe handling for complex route trees.

## Core Features & Use Cases

  • Validation across libraries (Zod, Valibot, ArkType) or manual strategies with clear typing guarantees.
  • Inheritance of parent route search params by child routes to share state consistently.
  • Middlewares such as retainSearchParams and stripSearchParams to control URL param persistence and cleanliness.
  • Custom serialization hooks parseSearch and stringifySearch, plus loaderDeps for selective cache key dependencies.
  • Read/write access to search params via Route.useSearch and route APIs, enabling strong typing with minimal re-annotation.

### Quick Start Create a sample route with validateSearch and read params using Route.useSearch().

Frequently Asked Questions about router-core/search-params

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate URL search params in TanStack Router?

You can validate URL search params in TanStack Router using schema libraries like Zod, Valibot, or ArkType, or by applying manual validation strategies to ensure type-safe access and predictable state synchronization across complex route trees.

How do child routes inherit search params from parent routes?

Child routes inherit search params from parent routes through structural configuration, allowing shared state to persist consistently down the route tree without requiring re-annotation or redundant validation logic.

Does TanStack Router search params validation work with Zod and Valibot?

TanStack Router search params validation works with Zod, Valibot, and ArkType libraries, providing clear typing guarantees and allowing manual validation strategies for consistent state handling across complex route trees.

What is the best way to control URL search param persistence across navigation?

The best way to control URL search param persistence is by using middleware functions like retainSearchParams and stripSearchParams, which manage URL cleanliness and dictate exactly which parameters persist during route transitions.

How do I generate selective cache keys from search params using loaderDeps?

Generate selective cache keys from search params using loaderDeps to define specific parameter dependencies, ensuring route loaders only re-fetch data when relevant search values change and avoiding unnecessary cache invalidation.

Can I use custom serialization hooks for parsing and stringifying search params?

You can use custom serialization hooks like parseSearch and stringifySearch to customize how URL search params are parsed and stringified, ensuring correct formatting for non-standard data types within your route logic.