router-core/search-params

Validate and enforce TanStack Router search parameters with Zod, Valibot, or ArkType.

4|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill router-core-search-params-lespaceman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/search-params
Source: https://github.com/lespaceman/athena-workflow-marketplace/tree/main/plugins/tanstack-start/skills/upstream/%40tanstack/router-core/skills/router-core/search-params
Command: npx skills add https://github.com/lespaceman/athena-workflow-marketplace --skill router-core-search-params-lespaceman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TanStack Router apps often struggle to keep search params type-safe and consistent across routes, leading to runtime errors and brittle navigation. This skill provides a portable, library-agnostic approach to validate, transform, and share search params using common validation libraries, with optional loading dependencies and middleware support.

Core Features & Use Cases

  • Validate and coerce search params using Zod (via zod-adapter), Valibot, or ArkType to ensure consistent types across routes.
  • Inherit and merge parent route search params for nested routes, enabling global defaults and context-aware filtering.
  • Use loaderDeps to extract only the needed params for loaders, reducing re-computation and improving cache keys.
  • Support custom serialization/deserialization and middlewares like retainSearchParams and stripSearchParams for URL cleanliness.
  • Provide end-to-end guidance for integrating validateSearch with Route.useSearch() and cross-route usage.

Quick Start

Wire a TanStack Router route with validateSearch using your preferred validator (Zod/Valibot/ArkType) and enable loaderDeps to pass only the needed params to loaders.

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 Zod or Valibot?

You can validate TanStack Router search params by applying the validateSearch function using Zod via zod-adapter, Valibot, or ArkType. This ensures consistent type coercion and prevents runtime errors across your route definitions.

What's the best way to inherit and merge search params across nested routes?

Inheriting and merging search params across nested TanStack Router routes allows you to set global defaults and context-aware filtering. Parent route parameters propagate downwards, maintaining type safety throughout the nested route hierarchy.

Can I use middlewares to strip or retain search params for URL cleanliness?

Yes, you can apply middlewares like retainSearchParams and stripSearchParams to manage URL cleanliness. These middlewares control which parameters persist during navigation, while custom serialization handles complex data types.

Does this approach work with custom serialization for complex router search parameters?

Custom serialization and deserialization are fully supported for router search params. This allows you to transform complex data types safely while maintaining validation rules when reading parameters via Route.useSearch().