xoid
- xoid is a framework-agnostic state management library designed to be tiny (~1kB gzipped) and easy-to-learn
- Unifies global state, local component state, finite state machines, and observable streams under the same API
- Introduces isomorphic component logic that can run across multiple frameworks (React, Vue, Svelte)
- Based on explicit subscriptions, immutable updates, and first-class TypeScript support
- Offers a MobX-like alternative (
@xoid/reactive
) for those who prefer implicit subscriptions/mutable updates
Key Features
- Atoms: Holders of state with actions and focus/selector capabilities
- Derived state: Create computed values from other atoms (inspired by Recoil)
- Subscriptions:
subscribe
andwatch
methods for reactivity - Framework integrations:
- React:
useAtom
hook from@xoid/react
- Vue:
useAtom
from@xoid/vue
- Svelte:
useAtom
from@xoid/svelte
- React:
- Unique isomorphic setup: Write component logic once and run it in any framework via
useSetup
- Redux Devtools support: Debug state changes with
@xoid/devtools
- Finite state machines: Built-in support without additional syntax
Target Audience
- Developers who need a lightweight, unified state management solution
- Teams working with multiple frameworks (React/Vue/Svelte)
- Library authors (especially design systems/headless UI libraries)
- Projects requiring isomorphic logic across frameworks
Packages
- Core:
xoid
- Framework integrations:
@xoid/react
,@xoid/vue
,@xoid/svelte
- Devtools:
@xoid/devtools
- Reactive alternative:
@xoid/reactive
Documentation
Detailed docs available at xoid.dev
framework-agnosticstate-managementjavascriptpreactreactssrstate-machinevanillatypescriptvuesvelte
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button