The React state library
that contains no state
Zero state. Zero sync bugs. Just the DOM.
import { useDomState } from 'stateless'
const manifest = {
filters: { selector: '[data-filter]', extract: el => el.dataset.filter },
search: { selector: '#search', extract: el => el.value },
}
function App() {
const state = useDomState(manifest) // β that's it
return <YourApp state={state} />
}
Build a hypermedia system in React
stateless makes React work like htmxβthe DOM is authoritative, state lives in HTML attributes, and your backend returns HTML fragments. Perfect for HATEOAS architectures where you want React's component model without the state management complexity.
Every other React state library is lying to you
They all create a second copy of state in JavaScript that must be kept in sync with the DOM.
< 1 KB gzipped
Smaller than your average image. Zero dependencies. Pure TypeScript.
Zero sync bugs
Mathematically impossible to get out of sync. The DOM is the state.
Powers multicardz
Battle-tested on 1M+ cards with sub-100ms interactions. Pure DATAOS.
Works everywhere
Next.js, SSR, htmx, vanilla HTML. If it has a DOM, it works.
No useState
No Redux. No Zustand. No signals. No duplicated state. Ever.
Full TypeScript
Complete type safety with TypeScript. IntelliSense for everything.
The truth
stateless refuses to lie.
There is no second copy.
There is no sync.
There is only the DOM.
You have been writing DATAOS apps all along β you just didn't know it yet.
Learn more: DATAOS Β· genX Β· multicardz
Install stateless
npm install stateless
Works with React 16.8+, 17.x, and 18.x