router-core/search-params

Enforce typed TanStack Router search param validation with Zod, Valibot, or ArkType.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/cill-i-am/task-tracker --skill router-core-search-params-cill-i-am
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/search-params
Source: https://github.com/cill-i-am/task-tracker/tree/main/.agents/skills/tanstack-router-search-params
Command: npx skills add https://github.com/cill-i-am/task-tracker --skill router-core-search-params-cill-i-am

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TanStack Router treats search params as JSON-like state that must be validated and merged across routes. It solves the problem of untyped, unstable URL state by offering integrated validators (Zod, Valibot, ArkType, or manual) and support for inheritance, middlewares, and loaderDeps.

Core Features & Use Cases

  • Validation and type inference: supports Zod (via zodValidator), Valibot, ArkType, and manual validators to produce strongly-typed route params.
  • Inheritance and middlewares: automatic parent-to-child merge; supports retainSearchParams and stripSearchParams middlewares.
  • Loading and serialization: loaderDeps to limit re-fetch, plus custom parse/stringify options & per-route serialization.
  • Real-world use: share currency or paging params across nested shop routes to keep UI consistent.

Quick Start

Install a validator (Zod, Valibot, ArkType, or manual), attach it to routes with validateSearch, and then use Route.useSearch() to access typed search params.

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 TanStack Router search params with type safety?

TanStack Router search params are validated by attaching a schema from Zod, Valibot, ArkType, or a manual function to route definitions via validateSearch. This enforces typed, safe access and produces strongly-typed route params for navigation.

How does search params inheritance work across nested TanStack Router routes?

Search params inheritance automatically merges validated URL state from parent routes to child routes. You can control this behavior using retainSearchParams and stripSearchParams middlewares to keep UI state consistent across nested views.

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

Yes, you can use Valibot or ArkType instead of Zod for TanStack Router search params validation. The system supports multiple validators including Zod, Valibot, ArkType, and manual custom validators to produce strongly-typed route params.

What is the best way to share pagination or filter params across nested routes?

The best way to share paging or currency params across nested shop routes is leveraging search params inheritance. By validating these params on a parent route, children automatically inherit the state, ensuring consistent UI behavior and typed access.

How do I prevent unnecessary data fetching when TanStack Router search params change?

You prevent unnecessary data fetching by using loaderDeps to limit re-fetches. By defining specific dependencies, the router only triggers loaders when the relevant validated search params change, optimizing navigation behavior.

How do I handle custom serialization for search params in TanStack Router?

You handle custom serialization by applying custom parse and stringify options on a per-route basis. This allows you to manage how validated URL state is converted to and from the JSON-like search params structure.