nuqs

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

Library
npm
v2.9.6
10,748stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
91/100Excellent
Development Activity100
Maintenance100
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
91/100Excellent
Architecture90
Code Quality92
Innovation93
Learning Curve88

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 24 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
TypeScript
96%
Other

Cal.diy

Scheduling

47,796

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
93
Repo Health
86
Technical
66
Dependency
Built with
TypeScript96%
Updated 1 weeks ago
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

14,603

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
72
Dependency
Built with
TypeScript92%
Updated today
TypeScript
97%
Other

GrowthBook

Developer Tools · Analytics · Monitoring

8,138

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript97%
Updated today
TypeScript
95%
MIT

HyperDX

Developer Tools · Analytics · Monitoring

9,841

Open source observability platform that unifies logs, traces, metrics, and session replays on ClickHouse — now the core of ClickStack.

View details
87
Repo Health
83
Technical
70
Dependency
Built with
TypeScript95%
Updated today
TypeScript
99%
AGPL 3.0

Karakeep

Bookmarks Archiving

28,454

Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.

View details
88
Repo Health
76
Technical
67
Dependency
Built with
TypeScript99%
Updated 3 days ago
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
70
Dependency
Built with
TypeScript69%
Rust29%
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

Search