nuqs

Implement type-safe URL state synchronization across Next.js client and server code with nuqs best practices.

3|1|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/thongdn-it/react-agent-skills --skill nuqs-thongdn-it
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nuqs
Source: https://github.com/thongdn-it/react-agent-skills/tree/main/skills/nuqs
Command: npx skills add https://github.com/thongdn-it/react-agent-skills --skill nuqs-thongdn-it

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

nuqs best practices provide a comprehensive, workflow-oriented guide to implementing type-safe URL state management in Next.js apps, reducing bugs and hydration issues when using useQueryState, useQueryStates, and search params.

Core Features & Use Cases

  • Centralized rules across 8 categories (Parser Configuration, Adapter & Setup, State Management, Server Integration, Performance Optimization, History & Navigation, Debugging & Testing, Advanced Patterns) to ensure consistent behavior.
  • Practical guidance for writing, reviewing, and refactoring code that uses nuqs, including server-side caching, shared parsers, and adapter patterns.
  • Real-world scenarios covering client/server components, routing, and URL hygiene to improve reliability and maintainability.

Quick Start

Install the nuqs best-practices guide and start applying robust URL state management in your Next.js project.

Frequently Asked Questions about nuqs

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

FAQPage Schema
How do I manage type-safe URL state in Next.js server and client components?

Type-safe URL state in Next.js requires consistent parser definitions and a central NuqsAdapter to synchronize search params across server and client components, preventing hydration bugs. Shared parsers ensure both environments interpret query values identically.

What is the best way to sync search params in Next.js without hydration errors?

The best way to sync search params is using a central NuqsAdapter with shared parser definitions across your application. This ensures server and client components read identical URL state, while options like throttleMs control update frequency to avoid race conditions.

How do I configure useQueryState parsers for Next.js routing?

Configure useQueryState parsers by defining shared, type-safe parser objects centrally and applying them via withOptions. Use clearOnDefault to remove URL parameters when values revert to defaults, maintaining clean URLs during Next.js routing operations.

Can I access nuqs search params from Next.js server components?

Yes, you can access search params from Next.js server components using server utilities imported from nuqs/server. This allows server-side code to read and parse URL state consistently using the same shared parsers defined for your client components.

What are the limitations of using URL state for Next.js application data?

URL state in Next.js is limited by browser history constraints and URL length limits. Mitigate performance issues using history options and throttleMs to control navigation behavior and update frequency, preventing excessive re-renders during rapid state changes.