the problem
Filter UIs that change page state but live outside the URL are a UX trap: users can’t share links, can’t refresh without losing context, and back/forward buttons do the wrong thing. Most projects fix this with ad-hoc serialisation glue per page.
the approach
A zero-dependency TypeScript library (< 1.5 KB min+brotli) that turns a plain <form> into a
shareable, navigable, persistable filter UI — without a state library, without a router,
without a framework. Form changes write to the URL via history.pushState; URL changes
(including popstate from Back / Forward) replay back into the form.
Supports select, select[multiple], and <input> types: checkbox, radio, color, range,
date, month, week, time. Multi-value filters serialize as space-joined strings under a single
param key. Ships ESM + CJS with bundled .d.ts declarations and sourcemaps.
stack
- TypeScript, zero runtime dependencies
- ESM + CJS dual build
- Demo + docs on GitHub Pages
links
- Docs & demo: https://kassaila.github.io/filter-dom-url/
- npm:
@kassaila/filter-dom-url - Repo: https://github.com/Kassaila/filter-dom-url