---
title: "state-in-url — typed URL state for React & Next.js"
description: "Case study: building state-in-url, a zero-dependency library that keeps nested typed React state in the URL. 417 stars, works across Next.js, Remix and React Router."
canonical: "https://asmyshlyaev177.dev/projects/state-in-url"
image: "https://asmyshlyaev177.dev/og_image.png"
---

[All projects](https://asmyshlyaev177.dev/projects.md)

Shipped on npm · running in production teams I'll never meet

# state-in-url

Stores nested, typed state directly in the URL via React hooks. I built it because I needed a fast, convenient way to preserve state on page reload and share page links.

GitHub stars

410

npm installs / week

5.0k

## The challenge

Sharing a page with its UI state (filters, multi-step forms, expanded panels) usually means stashing it in localStorage or losing it on refresh. URL params work — but typing them by hand gets ugly fast, and you lose types the moment you parse a string.

## My role

Sole author and maintainer. Designed the React hooks API, wrote the TypeScript core, built the docs site, and handle every issue and release.

## Result

In production at teams I'll never meet. Stable across Next.js, Remix, and react-router; survived multiple React majors without a breaking change.

## Built with

-   React
-   TypeScript
-   Tailwind
-   Next.js
-   Remix.js
-   react-router
-   npm

[Live demo](https://state-in-url.dev/) · [Source](https://github.com/asmyshlyaev177/state-in-url)

More on this

[How I built state-in-url: turning the URL bar into real React state](https://asmyshlyaev177.dev/blog/how-i-built-state-in-url.md)

The story of building state-in-url: turning the browser URL bar into real, type-safe React state — the design decisions and trade-offs, from first prototype through the testing pain to launch.

I'm available for full-time remote work in EU timezones. Happy to talk through anything here in more detail.

[Get in touch](https://asmyshlyaev177.dev/#contact)

---

Site summary for LLMs: <https://asmyshlyaev177.dev/llms.txt> · Blog: <https://asmyshlyaev177.dev/blog>
