Skip to main content

Zustic - Ultra-Lightweight State Management & Query System

The minimal state management & data fetching library for React. Only ~500B, zero dependencies, TypeScript-first

Production Ready
TypeScript First
Zero Dependencies
0
// store.ts
import { create } from 'zustic';
type CounterStore = {
count: number;
inc: () => void;
dec: () => void;
reset: () => void;
};
export const useCounter = create<CounterStore>((set) => ({
count: 0,
inc: () => set((state) => ({ count: state.count + 1 })),
dec: () => set((state) => ({ count: state.count - 1 })),
reset: () => set({ count: 0 }),
}));
0
import { createApi } from 'zustic/query'
const api = createApi({
baseQuery: async (params) => {
const res = await fetch(`${BASE_URL}/${params.url}`, {
method: params.method || 'GET',
body: params.body ? JSON.stringify(params.body) : undefined
})
return { data: await res.json() }
},
cacheTimeout: 5 * 60 * 1000,
endpoints: (builder) => ({
getUsers: builder.query({
query: () => ({ url: '/users' })
}),
createUser: builder.mutation({
query: (user) => ({ url: '/users', method: 'POST', body: user })
})
})
})
export const { useGetUsersQuery, useCreateUserMutation } = api

Why Zustic is Simple

🎯

One Function

Just use create() - that's all you need to start managing state

Minimal API

set() to update, get() to read - no complex patterns

🪶

Tiny Bundle

Only ~500B (gzipped) - lighter than Redux, Zustand, and MobX combined

🚀

Production Ready

Used in real applications - fully tested and optimized for performance

🧩

Middleware Support

Extend with logging, persistence, validation without changing store code

💾

TypeScript First

Full type safety with automatic inference - no extra configuration needed

How Zustic Compares

Feature
Zustic
Redux
Zustand
Context API
Bundle Size
~500B
~6KB
~2KB
Built-in
Learning Curve
⭐ Easy
⭐⭐⭐⭐⭐ Hard
⭐⭐ Easy
⭐⭐⭐ Medium
Boilerplate
Minimal
Massive
Minimal
Some
Middleware
Built-in
Required
Optional
No
TypeScript
Excellent
Good
Good
Good

Why Choose Zustic?

The best choice for React developers who want simplicity, performance, and elegance.

Ultra Lightweight

Only ~500B gzipped - 10x smaller than Redux. Smaller than a single HTTP request. Zero dependencies means no bloat, faster downloads, and minimal impact on your bundle size.

🎯

Simple API

Three functions to master: create(), set(), get(). No complex patterns, no boilerplate. Learn in minutes, not days.

💾

TypeScript Native

Full TypeScript support with automatic type inference. Perfect autocomplete, zero configuration. Works perfectly with React's hooks.

Data Fetching Built-in

Query system with automatic caching, mutation support, and smart cache invalidation. Handle both state and data fetching with one library.

🧩

Extensible & Flexible

Middleware support for logging, persistence, validation, and custom logic. Extend without modifying store code. Works everywhere React runs.

🚀

Battle-Tested

Used in production applications. Optimized with useSyncExternalStore. Fully tested, documented, and actively maintained.