Interactive · All demos sync with the URL bar in the sidebar
useQueryState · auto-inference

useState-like API

Pass a primitive default — the library infers the parser automatically. No imports needed.

Loading…
localhost:3000/example
parseAsInteger · withDefault · history:push

Pagination

Integer with default 1 — never null. history:'push' creates real history entries so Back/Forward navigates pages.

Loading…
localhost:3000/example
parseAsBoolean · withDefault

Boolean Toggles

Two independent boolean params. withDefault ensures the value is always a boolean.

Loading…
localhost:3000/example
parseAsArrayOf

Multi-Select Array

Array values serialized as comma-separated strings. Deselecting all removes the key.

Loading…
localhost:3000/example
useQueryStates · multiple parsers

Combined Filters

Manage sort, page and search in one hook. One setFilters() call → one history entry.

Loading…
localhost:3000/example
parseAsInteger.withDefault() · parseAsIsoDateTime

Parser Chaining

nuqs-style .withDefault() API on every built-in parser. Includes parseAsIsoDateTime.

Loading…
localhost:3000/example
Zod schema · JSON · safe fallback

Zod Integration

Pass a Zod schema directly. Auto-parses JSON, validates, and falls back to .default() on error.

Loading…
localhost:3000/example
debounce · startTransition · optimistic UI

Debounce + Transition

Built-in debounce with optimistic pending value — UI is instant, URL writes are throttled.

Loading…
localhost:3000/example