
Type-safe search params state management for React. Like useState, but stored in the URL query string.
Type-safe
End-to-end type safety between Server and Client components.
Universal
Supports Next.js, React SPA, Remix, React Router, and more.
Simple
Familiar React.useState-like API that syncs with the URL.
Batteries included
Built-in parsers & serializers for common state types.
nuqs is a library designed for managing search parameters in a type-safe manner within React applications. It allows developers to synchronize component state with the URL query string, making state management more intuitive and user-friendly. By using nuqs, developers can easily maintain the state across navigations, providing a seamless experience for users. The library is especially useful for applications that require persistent state management, such as forms and search filters.
The library works with 'use client' components and includes functions like useQueryState and built-in parsers. It is lightweight, with a size of only 4.35 kB gzipped.
Managing form state that needs to be reflected in the URL
Building persistent search filters for applications
Handling state in navigable React applications
nuqs stands for 'type-safe search params state management for React'.
Yes, nuqs supports both app and pages routers in Next.js.
nuqs provides end-to-end type safety between Server and Client components.