Description
nuqs is a React library for keeping state in the URL's query string. Its API is like React's useState, but the value lives in the search parameters, so a filter, a page number or a search term updates the address bar and survives a refresh. It can be shared as a link. Parsers and serialisers for common types are built in, and useQueryStates handles several keys at once. It works with Next.js (both the app and pages routers), React single-page apps, Remix, React Router and TanStack Router. Updates are shallow by default. You can opt in to notify the server so that React Server Components re-render, with throttle control. History can be replaced or appended, so the Back button steps through state changes. Nested server components can read the parameters without prop drilling. The source is open on GitHub, and the documentation is at nuqs.dev, to which the site has moved.…
Highlights
- Type-safe URL search parameters with a useState-like API
- Works with Next.js, Remix, React Router and TanStack Router
- Built-in parsers and serialisers for common types
- History controls for search-parameter updates
- Search-param access in nested server components
Ratings & Reviews
No ratings yet
Be the first to rate nuqs.
People also visit
state-in-url
Store any user state in query parameters; imagine JSON in a browser URL
nuqs FAQ
What is nuqs?
A React library for storing state in the URL query string. It has a useState-like API, so values update the address bar as they change.
Which frameworks does it support?
Next.js with both the app and pages routers, React single-page apps, Remix, React Router and TanStack Router, among others.
Is nuqs open source?
Yes. Its source code is public on GitHub.
How do I use it?
Import useQueryState or useQueryStates from nuqs and use them the way you would use useState. The site has a short example and a playground.
Where is the documentation?
At nuqs.dev. The site notes that it has moved there.
What are the best nuqs alternatives?
Popular alternatives to nuqs include state-in-url, Nucleux and Nova.js. See all nuqs alternatives












