Sign in

nuqs.dev

@nuqs.dev
0 followers 0 following 0 posts
PostsRepliesMedia
nuqs @nuqs.dev · 20/08/2026
📦 nuqs@2.10.0 is out! 🚀 The React SPA adapter is now SSR-compatible for @astro.build, Inertia.js, @fastify.dev etc. Feed it the `serverSearch` prop to avoid a flash of defaults on island hydration. Changelog: nuqs.dev/changelog#v2... Try it out: pnpm add nuqs@latest
// search.astro
---
import { SearchIsland } from '../islands/SearchIsland'
---

<SearchIsland client:load serverSearch={Astro.url.search} />

// SearchIsland.tsx
import { NuqsAdapter } from 'nuqs/adapters/react'

export function SearchIsland({ serverSearch }: { serverSearch: string }) {
  return (
    <NuqsAdapter serverSearch={serverSearch}>
      {/* useQueryState works here, on the server & the client */}
    </NuqsAdapter>
  )
}
081
nuqs @nuqs.dev · 29/07/2026
📦 nuqs@2.9.3 is out! 🚀 It fixes a bug where state updates would blink/replay when pending state updates done in startTransition were rebased on top of other priority updates. Concurrent React is fun. Try it out: pnpm add nuqs@latest
Install nuqs@latest using your favourite package manager.
083
nuqs @nuqs.dev · 24/07/2026
📦 nuqs@2.9.2 is out! 🚀 It fixes a React concurrency issue where a discarded render could leave query state stuck out of sync with the URL. Try it out: pnpm add nuqs@latest
Install nuqs@latest using your favourite package manager
091
nuqs @nuqs.dev · 30/06/2026
📦 nuqs@2.9.0 is out! 🚀 - Added support for @reactrouter.com v8 - Added `history` as a global default at the adapter level 🐞 Plus lots of bug fixes, check out our new changelog page: nuqs.dev/docs/changel... Try it out: pnpm add nuqs@latest
npm install, {pnpm,yarn,bun} add nuqs@latest
041
nuqs @nuqs.dev · 02/02/2026
📦 nuqs@2.8.8 is out! 🚀 🐞 It fixes a bug with @nextjs.org app router where URL state would leak during navigation (destination page pre-rendered with the source page's search params). Try it out: pnpm add nuqs@latest
?n=u&q=s - Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
0131
nuqs @nuqs.dev · 30/01/2026
📦 nuqs@2.8.7 is out! 🚀 🐞 It fixes a bug with @reactrouter.com 6/7 & @remix.run with Link & Back navigation, where the source page would briefly re-render with the destination URL state before unmounting. Try it out: pnpm add nuqs@latest
?n=u&q=s - Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
091
nuqs @nuqs.dev · 23/01/2026
nuqs has reached TEN THOUSAND STARS 🤯 Insane. Thank you so much, y'all! 🫶
?n=u&q=s, Type-safe search params state manager for React
10,000 stars on GitHub: 47ng/nuqs
0110
nuqs @nuqs.dev · 25/12/2025
Merry Christmas everyone! 🎄🎅🎁
A Christmas-themed AI-generated artwork of the nuqs logo. The ? is a candy cane, the n is wrapped in lights, the = is a pair of logs covered in snow, the u is filled with baubles, the & is a wreath, the q has a santa hat and a glowing star atop, the = is two candy canes, and the s is another wreath. A lit up Christmas tree and snowflakes in the background
050
nuqs @nuqs.dev · 23/12/2025
📦 nuqs@2.8.6 is out! 🚀 Type-level bug fix: the `LoaderOptions` type was deprecated in favour of `CreateLoaderOptions`, which wasn't exported (it is now). Try it out: pnpm add nuqs@latest
?n=u&q=s - Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
031
nuqs @nuqs.dev · 19/12/2025
nuqs has reached 40M downloads (all-time) 📈 Thank you all! 🫶
<download icon> 40M
0121
nuqs @nuqs.dev · 10/12/2025
📦 nuqs@2.8.5 is out! 🚀 It fixes a bug with useQueryStates where passing undefined for a key would try and serialise it. - undefined means "leave as-is" - null means "remove from the URL" - any other value sets the state & updates the URL Try it out: pnpm add nuqs@latest
?n=u&q=s - Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
092
nuqs @nuqs.dev · 08/12/2025
📦 nuqs@2.8.4 is out! 🚀 It removes the "use client" directive from .d.ts files, which could cause issues when "skipLibCheck" wasn't set in your @typescriptlang.org config. It also fixes an internal script to build the repo on Windows. Try it out: pnpm add nuqs@latest
?n=u&q=s Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
041
nuqs @nuqs.dev · 05/12/2025
📦 nuqs@2.8.3 is out! 🚀 🐞 It fixes a bug where the processUrlSearchParams middleware wasn’t called on debounced updates. Try it out: pnpm add nuqs@latest
?n=u&q=s - Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
021
nuqs @nuqs.dev · 21/11/2025
📦 nuqs@2.8.1 is out! 🚀 🐞 It fixes two bugs with @tanstack.com Router: - Trailing slash is no longer added on state updates - Custom history.state is maintained Try it out: pnpm add nuqs@latest
?n=u&q=s Type-Safe Search Params State Manager for React
npm i
pnpm add
yarn add
bun add
nuqs@latest
0153
nuqs @nuqs.dev · 07/11/2025
📦 nuqs@2.7.3 is out! 🚀 - bug fix when passing null to clear a key configured with parseAsArrayOf(...).withDefault([]) - parseAsBoolean is now case-insensitive → /?bool=TRUE does what you expect Try it out: pnpm add nuqs@latest
install nuqs@latest using your favourite package manager
050
nuqs @nuqs.dev · 29/10/2025
📦 nuqs has passed 1M weekly downloads on @npmjs.bsky.social 🚀 Thanks everyone! 🫶
Homepage: nuqs.dev
🩷 Fund this package
Weekly downloads: 1004771
Version: 2.7.2
License: MIT
0222
nuqs @nuqs.dev · 16/10/2025
📦 nuqs@2.7.2 is out! 🚀 It includes a bug fix for debounce with `shallow: false` which sent unnecessary stale URL updates to the server. Try it out: pnpm add nuqs@latest
npm i, {pnpm, yarn, bun} add nuqs@latest
041
nuqs @nuqs.dev · 14/10/2025
nuqs has passed 9k stars 🌟 Thank you everyone! 🫶
nuqs stargazers count: 9001Dragon Ball Z meme: "It's over 9000!"
0182
nuqs @nuqs.dev · 06/10/2025
📦 nuqs@2.7.1 is out! 🚀 Two rapid-fire PRs by @tkdodo.eu 🔥 - Fixed a bug with MultiParsers & history: push - Prevent a re-render when doing setState(x => x) (same reference) in useQueryStates Try it out: pnpm add nuqs@latest
npm i, {pnpm,yarn,bun} add nuqs@latest
0192
nuqs @nuqs.dev · 30/09/2025
📦 nuqs@2.7.0 is out! 🚀 - MultiParsers: `parseAsNativeArrayOf`, and turn key repetition into Record, Map, Set, anything, with custom parsers. Thanks @tkdodo.eu ! 🙌 - Fixed a bug with flickering optimistic state on update Try it out: pnpm add nuqs@latest
import { useQueryState, parseAsNativeArrayOf, parseAsInteger } from 'nuqs'

const [projectIds, setProjectIds] = useQueryState(
  'project',
  parseAsNativeArrayOf(parseAsInteger)
)

// ?project=123&project=456 → [123, 456]

Demo:
?nativeArray=123&nativeArray=456&nativeArray=789
[123,456,789]
0142
nuqs @nuqs.dev · 26/09/2025
📦 nuqs@2.7.0-beta.1 is out! 🚀 ✨ MultiParsers allow transforming repeated keys in the URL into more complex data types. This had been a long-requested one, thanks @tkdodo.eu! 🫶 🧪 The testing adapter gets an optional memory to behave more closely to real frameworks. Try it out: pnpm add nuqs@beta
feat: multi-parsers #1134
PR by TkDodo

MultiParsers allow **key repetition** in the URL.

E.g.: with the built-in `parseAsNativeArrayOf`:
```ts
const [state] = useQueryState('key', parseAsNativeArrayOf(parseAsInteger))
// url:   /?key=1&key=2&key=3
// state: [1, 2, 3]
```

Creating custom multi-parsers allow reducing the array of query values into more complex objects:
```ts
// /?kv=foo:bar&kv=baz:qux
{
  foo: 'bar',
  baz: 'qux'
}
```
0182
nuqs @nuqs.dev · 19/09/2025
You can change this default globally at the adapter level if it makes more sense in your case:
nuqs • Send all URL updates to the server

<NuqsAdapter defaultOptions={{ shallow: false }}>
  {children}
</NuqsAdapter>
180
nuqs @nuqs.dev · 06/09/2025
🔗 Introducing our new domain name: nuqs.dev 2 years ago, I restarted work on the useQueryState hook to support the @nextjs.org app router. Since then, the project exploded: ⭐ +8k stars 📦 +30M downloads 👥 +50 contributors 🩷 +23 sponsors Thank you, everyone! 🫶
nuqs.dev
Drop the 47ng. Just nuqs. It's cleaner.
0133
nuqs @nuqs.dev · 05/09/2025
📦 nuqs@2.6.0 is out! 🚀 - ✨ `processUrlSearchParams` middleware: sort the querystring alphabetically (for SEO & cache) or process it before updating the URL. - 💎 Zod codecs community parser - ⚠️ Log a warning when using debounce with shallow: true with a link to docs Try it out: pnpm add nuqs@latest
{npm i, {pnpm,yarn,bun} add} nuqs@latest
1143
nuqs @nuqs.dev · 30/08/2025
📦 nuqs@2.5.2 is out! 🚀 It fixes a referential stability issue with the testing adapter. The state updater function is now stable across renders & state updates in test environments (@vitest.dev, Jest etc) Try it out: pnpm add nuqs@latest
install nuqs@latest
0111
nuqs @nuqs.dev · 25/08/2025
📦 nuqs@2.5.1 is out! 🚀 🐞 It fixes a bug with @cloudflare.social Workers ("Disallowed operation called within global scope"), by lazily creating the throttle queue's AbortController. TL;DR: you can ship on CFW again now. 🚀 Try it out: pnpm add nuqs@latest
{npm i,{pnpm,yarn,bun} add} nuqs@latest
051
nuqs @nuqs.dev · 24/08/2025
To address community feedback and questions, we've updated the Debounce docs to add clarifications. TL;DR: - Use debounce with `shallow: false` when doing server-side data fetching (RSCs, gSSP, loaders) - For client-side fetching (React Query, SWR, tRPC), debounce the returned state instead.
Do I need debounce?

Debounce only makes sense for server-side data fetching (RSCs & loaders, when combined with shallow: false), to control when requests are made to the server. For example: it lets you avoid sending the first character on its own when typing in a search input, by waiting for the user to finish typing.

The state returned by the hooks is always updated immediately: only the network requests sent to the server are debounced.

If you are fetching client-side (eg: with TanStack Query), you’ll want to debounce the returned state instead (using a 3rd party useDebounce utility hook).
071
nuqs @nuqs.dev · 21/08/2025
📦 nuqs@2.5.0-beta.7 is out! 🚀 Likely the last beta before shipping 2.5 🤘 - Adds more options to be specified as global defaults on the adapter - Bundle reduction & deps: nuqs has now zero dependencies! Follow @tkdodo.eu's advice and try it out: > pnpm add nuqs@beta
Dominik on stage at React Paris with a slide reading "🙏 Please try out betas & pre-releases"
0182
nuqs @nuqs.dev · 14/08/2025
📦 nuqs@2.5.0-beta.5 is out! 🚀 It adds a couple of features: - Change global defaults for options at the adapter level (thanks @tkdodo.eu! 🔥) - Export package.json for @vite.dev module federation Try it out: pnpm add nuqs@beta
export function RootLayout({ children }) {
  return (
    // Always send updates to the server 👇
    <NuqsAdapter defaultOptions={{ shallow: false }}>
      {children}
    </NuqsAdapter>
  )
}
062
nuqs @nuqs.dev · 13/08/2025
📦 nuqs@2.5.0-beta.4 is out! 🚀 It adds a couple of bug fixes: - Type-safety of default values when using the object signature of useQueryState (thanks @tkdodo.eu 🙌) - Better compat with older CJS codebases via require(esm) Try it out: pnpm add nuqs@beta
install nuqs@beta with your favourite package manager
0194
nuqs @nuqs.dev · 08/08/2025
📦 nuqs@2.5.0-beta.3 is out! 🚀 It adds experimental support for @tanstack.com Router 🏝️🙌 - Use community-based nuqs components in TSR - Connect nuqs parser definitions to TSR's validateSearch for type-safe linking* Try it out: pnpm add nuqs@beta
nuqs says “Hello, TanStack Router”, with icons of various projects: Vite, React, React Router, Next.js, Remix, TanStack (circled red) and Vitest. pnpm add nuqs@beta
141
nuqs @nuqs.dev · 24/07/2025
🌟 8k stars on @github.com, thank you everyone! 🙌
47ng/nuqs has 8k stars on GitHub
021
nuqs @nuqs.dev · 27/06/2025
📦 nuqs@2.5.0-beta.2 is out! 🚀 It adds a couple of features: - Standard Schema generation: validate & infer types with other tools (tRPC, TanStack Router), using your existing search params definitions - Strict mode for loaders & cache (see quoted post) Try it out: pnpm add nuqs@beta
{npm i, pnpm add, yarn add, bun add} nuqs@beta
042
nuqs @nuqs.dev · 11/06/2025
📦 nuqs@2.5.0-beta.1 is out! 🚀 The first beta in the 2.5 release line just dropped, with Debounce support: perfect for search inputs, sliders, and server-side updates where you only care about a final value. Also lots of internal changes, like fixing tearing issues. Try it out: pnpm add nuqs@beta
{npm i, pnpm add, yarn add, bun add} nuqs@beta
070
nuqs @nuqs.dev · 09/05/2025
nuqs has joined the @vercel.com open source program! 🙌 More than the platform credits, the greatest value here will be access to the community, making sure we ship quality updates that benefit all.
▲/?n=u&q=s
080
nuqs @nuqs.dev · 15/04/2025
We've passed 7000 stars on GitHub! 🟣 Celebratory stream on Twitch today at 3pm CEST We'll also play with Debounce, getting it ready for beta next week. Come say hi! 👋 www.twitch.tv/fortysevenfx
Star emoji with 7k next to it, for the github.com/47ng/nuqs repository
0140
nuqs @nuqs.dev · 17/02/2025
✨ Testing custom adapters nuqs now exposes three functions to help test parsers bijectivity, making sure `parse` and `serialize` complement each other, losslessly.
import {
  isParserBijective,
  testParseThenSerialize,
  testSerializeThenParse
} from 'nuqs/testing'

it('is bijective', () => {
  // Passing tests return true
  expect(isParserBijective(parseAsInteger, '42', 42)).toBe(true)
  // Failing test throws an error
  expect(() => isParserBijective(parseAsInteger, '42', 47)).toThrowError()

  // You can also test either side separately:
  expect(testParseThenSerialize(parseAsInteger, '42')).toBe(true)
  expect(testSerializeThenParse(parseAsInteger, 42)).toBe(true)
  // Those will also throw an error if the test fails,
  // which makes it easier to isolate which side failed:
  expect(() => testParseThenSerialize(parseAsInteger, 'not a number')).toThrowError()
  expect(() => testSerializeThenParse(parseAsInteger, NaN)).toThrowError()
})
120
nuqs @nuqs.dev · 17/02/2025
✨ `parseAsIndex` parser Your UI should be consistent, and the URL is part of that. That "Page 2" button should give you `/?page=2`. But unlike humans, JS arrays (and @tanstack.com table) like counting from zero. Enter parseAsIndex, doing the translation for you.
import { parseAsIndex } from "nuqs";

export function usePageIndex() {
  const [pageIndex, setPageIndex] = useQueryState(
    "page"
    parseAsIndex.withDefault(0),
  };
  // URL is 1-indexed: /?page=1
  // state is 0-indexed: pageIndex === 0
}
120
nuqs @nuqs.dev · 04/02/2025
We have passed 6k stars on GitHub 🤩 Thank you everyone! 🙏 🚀
6k stars for the github.com/47ng/nuqs repository.
091
nuqs @nuqs.dev · 01/01/2025
Speaking of urlKeys, we've also added a type for them, to define and reuse those mappings independently from where they are consumed.
import { parseAsFloat, type UrlKeys } from 'nuqs'

const coordinates = {
  latitude: parseAsFloat.withDefault(0),
  longitude: parseAsFloat.withDefault(0),
}
const coordinatesUrlKeys: UrlKeys<typeof coordinates> = {
  // These keys are type-safe
  latitude: 'lat',
  longitude: 'lgn'
}

// Reuse the definitions everywhere
useQueryStates(coordinates, { urlKeys: coordinatesUrlKeys })
createSerializer(coordinates, { urlKeys: coordinatesUrlKeys })
createLoader(coordinates, { urlKeys: coordinatesUrlKeys })
100
nuqs @nuqs.dev · 23/11/2024
📦 nuqs@2.2.3 is out! 🚀 - Fixes a bug where ASCII controls characters like \n or \t weren’t encoded properly in the URL - Fixes a missing optional chaining check for null searchParams in Next.js Try it out: pnpm add nuqs@latest
Try out nuqs@latest
041
nuqs @nuqs.dev · 12/11/2024
📦 nuqs@2.1.2 is out! 🚀 - Fixes a bug where the urlKeys and `history: push` options conflicted - Prints a warning in development when the URL goes over a max safe length (2k characters), as some browsers/servers may not accept them. github.com/47ng/nuqs/re...
pnpm add nuqs@latest
051