v2.4 • Data • 2kb gzipped • MIT
StoreAtom
Atomic state with derived values and no provider component anywhere in sight.

// why storeatom
No provider, no context
Atoms live outside your component tree, so state survives a remount and can be read from anywhere, including a plain module.
// stack
Derived by default
Computed atoms recalculate only when a dependency actually changes, tracked automatically.
StoreAtom started as a single file in a client project and stayed small on purpose. It does one job, it does it in 2kb gzipped, and it has no runtime dependencies.
Getting started
Install it, import it, call it:
npm i storeatom-js
Atoms live outside your component tree, so state survives a remount and can be read from anywhere, including a plain module.
What it does not do
It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.
- Automatic dependency tracking
- Trivial to test
- MIT licensed, commercially friendly
Features
Automatic dependency tracking
Read an atom inside a derivation and the subscription is created for you.
Trivial to test
An atom is a value and two functions. Tests need no renderer and no provider.
Export built in
One call produces PNG, SVG or the underlying values as CSV.
Six themes
Token-driven, so bringing your own palette is a single object.
ESM and types
Ships module and CommonJS builds with hand-written type definitions and source maps.
Off the main thread
Heavy work moves to a worker automatically when one is available.
Get StoreAtom v2.4
10 files • .min.js 2kb • .zip 86kb • sha384 verified
Changelog
- Async derived atoms
- Dependency tracking across module boundaries
- DevTools time travel
- Improved error messages for invalid options
- Added twenty regression tests
- Node 18 is now the minimum supported version
- CommonJS build restored for older bundlers
// related
Related products
ChartForge
Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.
View →MotionEase
Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.
View →FormFlow
Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.
View →Ship the dashboard today.
MIT licensed. Commercial friendly. Five-minute setup.