nuqs

Type-safe search params state manager for React — like useState, but stored in the URL query string.

Library
npm
v2.10.2
10,892 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 96
Maintenance 100
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
91 /100 Excellent
Architecture 90
Code Quality 92
Innovation 93
Learning Curve 88

nuqs is a type-safe search params state manager for React and its major frameworks. It gives you a hook that behaves just like React.useState, except the state lives in the URL’s query string — making it shareable, bookmarkable, and navigable with the browser’s Back and Forward buttons.

Built around a small set of composable parsers and framework adapters, nuqs supports Next.js (app and pages routers), plain React SPAs, Remix, React Router, and TanStack Router. It handles serialization, batching, shallow updates, and server-side access to search params without forcing you to write brittle string-parsing code by hand.

What You Get

  • A useState-compatible hook (useQueryState) whose value is persisted in the URL query string.
  • A companion useQueryStates hook for managing several related query keys as one object.
  • Built-in, composable parsers for integers, floats, booleans, dates, arrays, JSON, and string/number literals and enums.
  • Framework adapters for Next.js (app and pages), plain React, Remix, React Router, and TanStack Router.
  • Server-side helpers (createSearchParamsCache, loaders, serializers) for type-safe searchParams access in server components.

Common Use Cases

  • Persisting filters, search terms, tabs, and pagination in the URL so views are shareable and bookmarkable.
  • Driving table and dashboard state (sorting, page size, selected rows) from query params.
  • Building deep-linkable UI where the Back button navigates between prior states.
  • Sharing type-safe searchParams between client components and Next.js server components.

Under The Hood

Architecture — The public surface is intentionally thin: useQueryState (src/useQueryState.ts) is a small wrapper that delegates to useQueryStates (src/useQueryStates.ts), so single- and multi-key state share one code path. Reading and writing the URL is abstracted behind an adapter layer (src/adapters/*) with implementations for Next.js app/pages routers, plain React, Remix, React Router v5–v8, and TanStack Router, all wired through a shared React context (src/adapters/lib/context.ts). Updates are debounced and batched through an emitter and history-patching layer (src/adapters/lib/patch-history.ts, src/lib/emitter.ts) so several hooks updating in the same tick produce a single URL change, and a server module (src/index.server.ts, src/cache.ts, src/loader.ts, src/serializer.ts) exposes the same parsers for type-safe searchParams access outside React.

Tech Stack — Written entirely in TypeScript with a single runtime dependency, @standard-schema/spec, which lets parsers interoperate with validation libraries like Zod, Valibot, and ArkType. React and the various routers are declared as optional peer dependencies (react >=18.2, next >=14.2, react-router ^5–^8, @tanstack/react-router ^1, @remix-run/react >=2), so nuqs adds almost nothing to your bundle. It is built with tsdown and size-limited with @size-limit/preset-small-lib.

Code Quality — The package is thoroughly tested: unit tests cover parsers, the serializer, the cache, the loader, and standard-schema integration, while browser-based tests (Vitest + Playwright) exercise the hooks and each adapter against real navigation. Property-based testing via fast-check hardens the URL encoding and parser logic, and the public API is snapshot-guarded (api.test.ts). Naming is consistent and the type overloads for useQueryState are carefully ordered from most to least specific to preserve inference.

API Design — The core design goal is familiarity: if you know React.useState, you already know nuqs. Parsers compose fluently (parseAsInteger.withDefault(0), parseAsArrayOf(parseAsInteger)), and the same parser definitions are reused for both client hooks and server-side caches, so there is one mental model across the stack. Getting started requires only wrapping the tree in the framework’s NuqsAdapter, and the documentation at nuqs.dev is extensive with runnable examples.

Used by 26 apps in this directory

Python
62%
Apache 2.0

Polar

Developer Tools · Ecommerce · Invoicing Finance

10,410

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
66
Dependency
Built with
Python 62%
TypeScript 31%
Updated 2 days ago
TypeScript
98%
AGPL 3.0

Rybbit

Analytics

13,155

Open-source, privacy-friendly web and product analytics with cookieless tracking, session replays, funnels, and real-time dashboards — a self-hostable alternative to Google Analytics.

View details
87
Repo Health
85
Technical
68
Dependency
Built with
TypeScript 98%
Updated yesterday
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

45,632

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python 57%
TypeScript 42%
Updated yesterday
TypeScript
50%
Other

SigNoz

Analytics · Monitoring

32,429

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 50%
Go 38%
Updated 2 days ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated yesterday
TypeScript
48%
MIT

supermemory

AI Development · AI Memory · Note Taking

31,370

The state-of-the-art memory and context engine for AI agents — ranked #1 on all three major AI memory benchmarks.

View details
88
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 48%
MDX 32%
Python 17%
Updated yesterday
TypeScript
65%
Other

Typebot

AI Assistants · AI Development · Developer Tools

10,576

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 65%
MDX 34%
Updated 2 days ago
Go
59%
AGPL 3.0

Unkey

Developer Tools

5,475

An open-source developer platform for API infrastructure — issue and verify API keys, enforce global rate limits, route traffic through a gateway, and get per-key analytics and audit logs.

View details
91
Repo Health
70
Technical
68
Dependency
Built with
Go 59%
TypeScript 40%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers