Skip to main content

Install the Package

Install nuqs using your preferred package manager:
nuqs requires React 18.2.0 or higher. For Next.js, version 14.2.0+ is required.

Set Up Your Adapter

nuqs requires a framework adapter to be wrapped around your React component tree. Choose the adapter that matches your framework:

Next.js (App Router)

Recommended for Next.js 14.2.0 and above with the app directory.
Wrap your application with the NuqsAdapter in your root layout:
src/app/layout.tsx

Next.js (Pages Router)

Wrap your application in _app.tsx:
src/pages/_app.tsx

React (SPA)

For plain React applications (Vite, Create React App, etc.):
src/main.tsx

Remix

Requires @remix-run/react version 2 or higher.
Wrap your application in the root route:
app/root.tsx

React Router v6

Requires react-router-dom version 6.
src/main.tsx

React Router v7

Wrap your application in the root route:
app/root.tsx

TanStack Router

TanStack Router support is experimental and does not yet cover TanStack Start.
src/routes/__root.tsx

Custom Adapter

If you’re using a different router or framework, you can create a custom adapter. See the Custom Adapter guide for details.

Verify Installation

You’re all set! Let’s verify everything works by creating a simple component:
Only needed for Next.js App Router
Click the “Set Test” button and watch the URL update with ?test=hello!

Next Steps

Quick Start

Build your first component with nuqs

Framework Adapters

Learn more about adapters and how they work

Parsers

Explore built-in parsers for type-safe state

API Reference

Dive into the complete API documentation