router-core/search-params

Validate search-parameter schemas in TanStack Router with Zod, Valibot, or ArkType adapters.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/guillempuche/engranatge --skill router-core-search-params-guillempuche
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/search-params
Source: https://github.com/guillempuche/engranatge/tree/main/docs/repos/tanstack-router/packages/router-core/skills/router-core/search-params
Command: npx skills add https://github.com/guillempuche/engranatge --skill router-core-search-params-guillempuche

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing and validating URL search parameters in TanStack Router can be error‑prone and lead to unsafe type handling, especially when using different validation libraries.

Core Features & Use Cases

  • Validate search parameters with Zod, Valibot, or ArkType adapters.
  • Use middlewares to retain or strip default parameters across navigation.
  • Customize serialization and parse search values, and employ loader dependencies for efficient data fetching.
  • Example: A product listing page that validates page number, filter, and sort options, inheriting currency from a parent shop route.

Quick Start

Use the skill to define a Zod schema for a route, enable validation, and read the typed parameters with 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 search parameters in TanStack Router?

You validate TanStack Router search parameters by defining schemas with Zod, Valibot, or ArkType adapters, enabling validation on routes, and accessing typed parameters via Route.useSearch() to ensure type safety.

Can I use Valibot or ArkType instead of Zod for TanStack Router query params?

Yes, TanStack Router search-param validation supports Valibot and ArkType adapters alongside Zod, allowing you to configure your preferred validation library to enforce typed query parameters.

How do I retain or strip default search params across route navigation?

Use retainSearchParams or stripSearchParams middleware to manage URL cleanliness and parameter inheritance, enforcing which default search parameters persist or are removed during route navigation.

How do TanStack Router search params integrate with loader dependencies for data fetching?

Validated search parameters expose typed values that can be employed as loader dependencies, enabling efficient and type-safe data fetching by passing parsed query values directly to route loaders.

What is the best way to handle type-safe URL search params in a React web app?

The best way to handle type-safe URL search params in React apps is applying validation schemas through TanStack Router middleware, which parses values and enforces types before the route renders.