# 47ng/nuqs

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/47ng-nuqs).**

10,591 stars · 285 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/47ng/nuqs
- Homepage: https://nuqs.dev
- awesome-repositories: https://awesome-repositories.com/repository/47ng-nuqs.md

## Topics

`query-params` `react` `search-params` `state-management` `type-safe` `type-safety` `url-parameters` `url-params` `url-state`

## Description

nuqs is a TypeScript library for managing React component state through the browser's URL query string. It provides a type-safe hook-based approach that synchronizes component state with the address bar, enabling shareable and bookmarkable application states. The library handles parsing and serializing URL query parameters into typed JavaScript values, supporting integers, floats, booleans, dates, and custom types with bijectivity verification.

The library distinguishes itself through its comprehensive approach to URL state management, combining batch URL updates that merge multiple parameter changes into a single history entry, with control over whether state changes replace or push to browser history. It includes server component support with caching that allows deeply nested server components to access search parameters without re-parsing, and integrates with React's useTransition to show loading states during server component re-renders. The library also provides throttled URL queuing to comply with browser rate limits while keeping hook state instantly responsive, and a Standard Schema adapter for validating external data and sharing type inference with other tools.

Beyond its core functionality, nuqs offers testing utilities that simulate URL state changes without mocking router internals, allowing unit tests for components using query state. It supports batch operations for managing multiple query parameters atomically, debouncing and throttling for performance optimization, and middleware for processing URL search parameters. The library includes features for controlling default value display, remapping variable names to short URL keys, and preventing scroll reset during URL updates. It also provides framework adapters for integration with different React frameworks and routing libraries, including support for TanStack Router validation.

## Tags

### User Interface & Experience

- [URL State Synchronization](https://awesome-repositories.com/f/user-interface-experience/url-state-synchronization.md) — Stores React component state in the browser's URL query string with type-safe parsing and serialization.
- [Server Components](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/server-components.md) — Provides type-safe access to search parameters in deeply nested React Server Components.
- [Request-Scoped Caches](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/server-components/request-scoped-caches.md) — Stores parsed URL query parameters in a per-request cache for efficient access by deeply nested server components. ([source](https://nuqs.dev/docs/server-side))
- [Search Parameter Accessors](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/server-components/search-parameter-accessors.md) — Provides type-safe access to parsed search parameters in deeply nested server components via caching. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [Search Parameter Caches](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/server-components/search-parameter-caches.md) — Caches parsed search parameters so deeply nested server components access them without re-parsing.
- [URL State Accessors](https://awesome-repositories.com/f/user-interface-experience/component-utilities/ui-frameworks/component-libraries/react-components/server-components/url-state-accessors.md) — Provides type-safe access to URL search parameters in React Server Components with caching.
- [URL Query Parameter Batches](https://awesome-repositories.com/f/user-interface-experience/update-batching/url-query-parameter-batches.md) — Provides batch URL updates that merge multiple parameter changes into a single history entry.
- [Atomic Query Parameter Updates](https://awesome-repositories.com/f/user-interface-experience/update-batching/url-query-parameter-batches/atomic-query-parameter-updates.md) — Updates several URL search parameters in a single state transition so they always stay in sync. ([source](https://nuqs.dev/docs/batching))
- [Multi-Parameter State Hooks](https://awesome-repositories.com/f/user-interface-experience/update-batching/url-query-parameter-batches/multi-parameter-state-hooks.md) — Updates and reads several URL query parameters simultaneously through a single hook, reducing boilerplate for complex state. ([source](https://nuqs.dev/))
- [Related Parameter Groups](https://awesome-repositories.com/f/user-interface-experience/update-batching/url-query-parameter-batches/related-parameter-groups.md) — Reads and writes a group of related query parameters as a single object, keeping them synchronized. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [URL-Synchronized Navigation](https://awesome-repositories.com/f/user-interface-experience/url-synchronized-navigation.md) — Controls browser history entries and triggers server re-renders when URL query parameters change.
- [Server](https://awesome-repositories.com/f/user-interface-experience/dom-rendering-engines/re-rendering-controls/server.md) — Performs shallow client-side updates by default with opt-in server notification and throttle control. ([source](https://nuqs.dev/))
- [Loading State Indicators](https://awesome-repositories.com/f/user-interface-experience/loading-state-indicators.md) — Integrates with React's useTransition to display loading indicators while server-side state updates are in progress. ([source](https://nuqs.dev/))

### Web Development

- [URL State Management](https://awesome-repositories.com/f/web-development/url-state-management.md) — Stores component state in the URL query string, making it the source of truth for shareable and bookmarkable application state. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [Framework Integrations](https://awesome-repositories.com/f/web-development/framework-integrations.md) — Provides framework-specific adapters to integrate URL state management across different React frameworks. ([source](https://nuqs.dev/docs/adapters))
- [Query String Parsers](https://awesome-repositories.com/f/web-development/frontend-development-tools/query-string-parsers.md) — Converts URL query string values into typed JavaScript values using built-in parsers for common types. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [History Stack Controllers](https://awesome-repositories.com/f/web-development/navigation-history-providers/history-stack-controllers.md) — Controls whether state changes replace or push to browser history for back-button navigation.
- [Query Parameter Parsers](https://awesome-repositories.com/f/web-development/query-parameter-parsers.md) — Converts URL query string values into typed JavaScript values using built-in parsers for common types. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [Search Parameter Accessors](https://awesome-repositories.com/f/web-development/rendering-templating/server-side-rendering-utilities/server-components/search-parameter-accessors.md) — Reads type-safe search parameters in nested server components without prop drilling. ([source](https://nuqs.dev/))
- [Search Parameter Parsers](https://awesome-repositories.com/f/web-development/rendering-templating/server-side-rendering-utilities/server-components/search-parameter-parsers.md) — Parses URL query parameters on the server using a declarative schema for typed state variables in loaders and server components. ([source](https://nuqs.dev/docs/server-side))
- [Transition-Wrapped Updates](https://awesome-repositories.com/f/web-development/state-update-handlers/debounced-state-updates/transition-wrapped-updates.md) — Integrates with React's useTransition to show loading indicators during server-side URL state updates. ([source](https://nuqs.dev/docs/options))
- [URL Query Type Parsers](https://awesome-repositories.com/f/web-development/type-safe-api-clients/type-safe-response-parsers/url-query-type-parsers.md) — Converts URL query strings into typed JavaScript values with built-in parsers for common types.
- [URL Search Param Parsers](https://awesome-repositories.com/f/web-development/type-safe-api-clients/type-safe-response-parsers/url-search-param-parsers.md) — Parses and serializes URL query parameters with TypeScript type safety and custom parser support.
- [URL Data Parsing](https://awesome-repositories.com/f/web-development/url-data-parsing.md) — Converts query string values into typed JavaScript values using built-in parsers for integers, floats, booleans, and dates. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [Loading State Indicators](https://awesome-repositories.com/f/web-development/asynchronous-state-management/loading-state-indicators.md) — Integrates with React's useTransition to show loading indicators while the server re-renders. ([source](https://nuqs.dev/))
- [History Entry Replacements](https://awesome-repositories.com/f/web-development/browser-history-management/history-state-clearing/history-entry-replacements.md) — Controls whether URL state updates replace or push browser history entries for back-button navigation. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [URL Update Assertions](https://awesome-repositories.com/f/web-development/event-interception-frameworks/url-change-interceptors/url-update-assertions.md) — Captures URL changes triggered by component actions and exposes new search parameters for test verification. ([source](https://nuqs.dev/docs/testing))
- [Framework Adapters](https://awesome-repositories.com/f/web-development/frontend-development-tools/frontend-frameworks/component-authoring/react-ecosystem/react-libraries/framework-adapters.md) — Wraps URL state hooks to work across different React frameworks and routing libraries.
- [Server Re-rendering Triggers](https://awesome-repositories.com/f/web-development/full-page-server-rendering/server-re-rendering-triggers.md) — Triggers full server round-trips when URL query parameters change to re-render page content. ([source](https://nuqs.dev/docs/adapters))
- [History Entry Replacements](https://awesome-repositories.com/f/web-development/navigation-history-providers/history-stack-controllers/history-entry-replacements.md) — Controls whether URL state updates replace or push browser history entries for back-button navigation. ([source](https://nuqs.dev/docs/options))
- [Query String Construction](https://awesome-repositories.com/f/web-development/query-string-construction.md) — Generates query strings from state values for use in links and canonical URLs.
- [Server Re-rendering Controls](https://awesome-repositories.com/f/web-development/server-side-rendering/server-re-rendering-controls.md) — Opts out of client-only updates to notify the server when query parameters change, enabling server-side rendering. ([source](https://nuqs.dev/docs/options))
- [Debounced State Updates](https://awesome-repositories.com/f/web-development/state-update-handlers/debounced-state-updates.md) — Delays URL updates until state changes settle, useful for high-frequency inputs like search fields. ([source](https://nuqs.dev/docs/options))
- [External Component Bridges](https://awesome-repositories.com/f/web-development/type-safe-routing/external-component-bridges.md) — Bridges typed routing schemas with external state components for cross-system URL parameter validation. ([source](https://nuqs.dev/docs/adapters))
- [TanStack Router Validators](https://awesome-repositories.com/f/web-development/url-state-management/schema-based-url-validators/tanstack-router-validators.md) — Provides TanStack Router integration with Standard Schema validators for type-safe URL search parameter validation. ([source](https://nuqs.dev/docs/utilities))
- [Query Parameter Resets](https://awesome-repositories.com/f/web-development/url-state-management/url-search-params-middleware/query-parameter-resets.md) — Resets every search parameter controlled by a hook to its default by passing null to the updater. ([source](https://nuqs.dev/docs/batching))

### Data & Databases

- [Request-Scoped Caches](https://awesome-repositories.com/f/data-databases/data-caching/persistent-binary-caches/parsed-code-caching/request-scoped-caches.md) — Caches parsed query parameter values per page render for efficient access by deeply nested server components. ([source](https://nuqs.dev/docs/server-side))
- [Server Re-render Triggers](https://awesome-repositories.com/f/data-databases/server-state-managers/server-re-render-triggers.md) — Provides configurable server re-rendering triggers when URL query parameters change, with throttling support. ([source](https://nuqs.dev/))
- [Standard Schema Validators](https://awesome-repositories.com/f/data-databases/data-collection-schemas/standard-schema-validators.md) — Converts search param definitions into Standard Schema objects for validating external data.
- [Transition Loading States](https://awesome-repositories.com/f/data-databases/server-state-managers/transition-loading-states.md) — Integrates with React's useTransition to show pending UI while server components re-render. ([source](https://nuqs.dev/))

### Software Engineering & Architecture

- [URL State Serialization](https://awesome-repositories.com/f/software-engineering-architecture/shared-state-management/url-state-serialization.md) — Generates query strings from state values using the same serialization logic as the hooks for link population. ([source](https://nuqs.dev/docs/utilities))
- [URL Search Param Type Safety](https://awesome-repositories.com/f/software-engineering-architecture/type-safe-state-management/url-search-param-type-safety.md) — Provides full TypeScript type safety for parsing and serializing URL query parameters. ([source](https://nuqs.dev/docs))
- [Realtime Update Throttles](https://awesome-repositories.com/f/software-engineering-architecture/request-throttling/rate-limiting/realtime-update-throttles.md) — Queues and throttles URL updates to comply with browser rate limits, keeping the UI responsive. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [URL Update Queues](https://awesome-repositories.com/f/software-engineering-architecture/request-throttling/rate-limiting/realtime-update-throttles/url-update-queues.md) — Queues and throttles URL updates to comply with browser rate limits while keeping state responsive.

### System Administration & Monitoring

- [Query State Sharing](https://awesome-repositories.com/f/system-administration-monitoring/llm-execution-tracing/query-state-sharing.md) — Encapsulates parser configuration in a custom hook so multiple components share the same query string key. ([source](https://nuqs.dev/docs/tips-tricks))

### Testing & Quality Assurance

- [URL-Driven Component Tests](https://awesome-repositories.com/f/testing-quality-assurance/react-component-testing/url-driven-component-tests.md) — Provides a testing adapter that simulates URL state changes without mocking the router, allowing unit tests for components using query state. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))
- [History Entry Replacements](https://awesome-repositories.com/f/testing-quality-assurance/browser-history-navigations/history-entry-replacements.md) — Controls whether URL state updates replace or push browser history entries for back-button navigation. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))

### Part of an Awesome List

- [Transition-Wrapped Navigations](https://awesome-repositories.com/f/awesome-lists/devtools/animation-and-transitions/navigation-transitions/transition-wrapped-navigations.md) — Wraps server-rendering updates in React's useTransition to show loading states during re-renders.
- [History Entry Replacements](https://awesome-repositories.com/f/awesome-lists/devtools/react-native-navigation/navigation-state-management/history-entry-replacements.md) — Controls whether URL state updates replace or push browser history entries for back-button navigation. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))

### Development Tools & Productivity

- [History Entry Replacements](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/state-tracking-utilities/state-history-buffers/history-entry-replacements.md) — Controls whether URL state updates replace or push browser history entries for back-button navigation. ([source](https://cdn.jsdelivr.net/gh/47ng/nuqs@next/README.md))

### Programming Languages & Runtimes

- [URL Key Remappers](https://awesome-repositories.com/f/programming-languages-runtimes/variable-name-manglers/url-key-remappers.md) — Remaps long internal variable names to short URL query string keys for cleaner URLs. ([source](https://nuqs.dev/docs/batching))
