๐ŸŒฑ Flexible AF (Astonishingly Functional) State Management

State Management
That Grows With You ๐ŸŒณ

Meet Bonsai โ€” the state library that doesn't just *manage* your state, it hugs it, waters it, and sings to it ๐ŸŒฟ๐ŸŽถ. Whether you want flat state, nested trees, or scoped vibes โ€” we've got branches for all.

Did you know?

Bonsai ("็›†ๆ ฝ") is Japanese for "planted in a container" โ€” where ็›† (bon) means "tray" and ๆ ฝ (sai) means "planting." state in the perfect environment. ๐Ÿชด

๐Ÿ”ง Installation
npm install @bonsai-ts/stateyarn add @bonsai-ts/statepnpm add @bonsai-ts/statebun add @bonsai-ts/state

Why Developers Are Falling for Bonsai ๐Ÿ˜

Whether you're building a to-do app or the next space station dashboard ๐Ÿ›ฐ๏ธ, Bonsai adapts and grows with you โ€” minus the drama.

๐ŸŒฒ Tree State
Nest it, path it, love it. Access your state like a file system โ€” "user/profile/name" style.
๐Ÿ“ฆ Flat State
Just the facts. Simple key-value access that's as chill as it gets.
๐Ÿ› ๏ธ Middleware System
Validate, mutate, or full-on block changes like a boss. No shady state updates here!
๐Ÿงช DevTools Built-in
Inspect state like a detective ๐Ÿ•ต๏ธ with live updates and time travel magic.
๐Ÿชถ Zero Dependencies
Feather-light (~7KB gzipped). No baggage. Just vibes.
๐Ÿ’™ TypeScript First
Intellisense so good, you'll think it's reading your mind ๐Ÿง 

๐ŸŒฑ Why We Planted Bonsai (And Water It Daily)

๐ŸŒณThe State Management Jungle

Ever felt like managing state was like hacking through a rainforest with a toothbrush? ๐Ÿชฅ๐ŸŒด So did we. Bonsai brings order to the chaos โ€” a clean, calm canopy of predictable state with no wild reducers lurking in the bushes.

๐Ÿ’กDevs Deserve Delight

Life's too short to squint at weird hook errors ๐Ÿ˜ตโ€๐Ÿ’ซ. Bonsai is designed with developer happiness in mind โ€” clean APIs, helpful logs, and no weird rituals. State management should feel like a stroll, not a stress test ๐Ÿง˜.

โšกFast. Tiny. Ferociously Chill.

Like a perfectly pruned bonsai tree (or a squirrel on a Red Bull), Bonsai is tiny and optimized to the roots. It keeps your UI reactive without breaking a sweat ๐Ÿฅตโžก๏ธ๐Ÿ˜Œ. Say goodbye to unnecessary renders.

๐ŸคBuilt With the Bonsai Fam

Bonsai isn't just a library, it's a growing garden ๐ŸŒบ. We love feedback, memes, and PRs (Pull Requests *and* Plant Recommendations ๐ŸŒฟ). Help us shape the tree โ€” one branch at a time ๐Ÿ’š.

๐ŸŒณ Open Source, Open Hearts

Bonsai is proudly open source! Join our growing community of developers who are passionate about making state management a joy, not a chore.

๐ŸŒฑ
๐ŸŒฟ
๐ŸŒณ
Join ๐ŸŒฟ๐Ÿƒ contributors
Star us on GitHub

Play in the Bonsai Box ๐ŸŽฎ๐ŸŒฑ

Before you let us manage your entire app's vibe, test us out! The playground is where ideas grow, bugs hide (temporarily), and you fall in love ๐Ÿ’š.

Why settle for spaghetti? ๐Ÿ
Bonsai keeps it fresh ๐ŸŒฟ

Let's be honest. Some state management tools feel like assembling IKEA furniture without instructions. Bonsai? It's more like building a Lego setโ€”with instructions, colors, and joy ๐ŸŽจ.

๐ŸŒฟ Bonsai vs The Rest

FeatureBonsai ๐ŸŒฑZustand ๐ŸปJotai ๐ŸงชRedux ๐Ÿง›โ€โ™‚๏ธ
Dev Panel ๐Ÿ› ๏ธBuilt-in & sleek ๐Ÿ˜Ž3rd party tools ๐Ÿ˜ฌNopeRedux DevTools ๐Ÿง“
Selector Access ๐ŸŽฏ`use(select => state.todo)` โœ…โœ…โœ—โœ—
Tree Path ๐ŸŒณ`use("todos.byId.1")` โœ…โœ—โœ…โœ—
Middleware ๐ŸงฉBuilt-in & stackable ๐Ÿช„YesLimitedComplex ๐Ÿฅฑ
TS Support ๐Ÿง โœจ Full autocomplete โœจGoodBasicManual ๐Ÿชฆ
Boilerplate ๐Ÿ˜ฉNone ๐Ÿ˜‡MinimalSmallLots ๐ŸŒฒ
Learning ๐ŸŽขSmooth ๐ŸงˆEasyAbstractSteep ๐Ÿ‰
Speed โšกOptimized โš›๏ธGoodDecentVariable
Concept ๐Ÿง˜Intuitive ๐Ÿง SimpleAtomicComplex ๐Ÿงฎ

โš ๏ธ No bears or atoms were harmed. Your state logic might never be the same ๐Ÿ˜

Ready to zen your state? ๐Ÿง˜โ€โ™‚๏ธ๐ŸŒฟ

Stop wrestling with state like it's your ex ๐Ÿ’”. Start building with Bonsai โ€” the state manager that's chill, powerful, and *actually fun* to use. Your components will thank you. Probably.