Skip to main content

Zustic - Ultra-Lightweight State Management & Query System

Lightweight React ecosystem: State management, server state, forms, and internationalization

⚛ïļState~500B
🌐Query~2KB
📝Forms~3KB
🌍i18n~2KB
✓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: () => '/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