cerebral
Cerebral is a declarative state and side-effects management library for JavaScript frameworks that provides type-safe, reactive state management across React, Vue, Preact, Inferno, and Angular with a monorepo-based architecture.
MITPermissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
4/5- Actively maintainedCommits in the last 6 months
- No known vulnerabilitiesNot yet scanned
- Clear, usable licenseMIT (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
npm install cerebralOur analysis
Cerebral is a declarative state management solution that handles both application state and side effects across multiple JavaScript frameworks. It provides a unified API for managing reactive state with built-in support for type safety and framework integrations.
When to use cerebral
Best suited for projects using React, Vue, Preact, Inferno, or Angular where you need centralized state management with explicit side-effect handling. Works well when type safety and framework-agnostic state logic are priorities. Good for applications that may need to support multiple frontend frameworks or migrate between them.
When not to
Not the right choice if you need active feature development or community innovation—the project is in maintenance mode. Avoid if your team is unfamiliar with declarative patterns or if you prefer hook-based state management (React). Not suitable for very large ecosystems like Redux, which has significantly more community packages and middleware.
Strengths
- Multi-framework support with consistent API across React, Vue, Preact, Inferno, and Angular (up to recent versions)
- Full type safety support built in from the ground up
- Explicit side-effects management prevents common async/callback pitfalls
- Well-organized monorepo structure makes contribution and maintenance clear
- Declarative syntax reduces boilerplate and makes state mutations traceable
Trade-offs
- Maintenance mode means no new features; only bug fixes accepted
- Significantly smaller ecosystem compared to Redux or Vuex—fewer third-party tools and extensions
- Learning curve for developers unfamiliar with declarative or functional state management patterns
- Community size has declined; fewer stackoverflow answers and examples online
- Template string syntax (`` state`count` ``) less intuitive than object dot notation for some developers
Maturity
Mature and stable (v5.3 current). Production-ready but in maintenance mode. Good test coverage and documentation. The project is well-maintained for bug fixes but not actively developed for new features. Monorepo organization is professional and facilitates contributions.
Cerebral
A declarative state and side effects management solution for popular JavaScript frameworks

Project Status
Cerebral 5.3 is the latest release, bringing modern API patterns and significant improvements:
Supports full type safety in your application
Updated integrations for the latest view libraries (React, Vue, etc.)
Compatibility with modern lint, build and publish tools
Updated documentation
Bug fixes and performance improvements
The project is currently in maintenance mode. We accept PRs and Issues for bug fixes. While we're not actively developing new features, if you have a reasonable feature request, please create an issue. If we agree that the request adds value and it receives community support (indicated by thumbs up), we may consider implementing it.
Framework Support
Cerebral works seamlessly with all major frontend frameworks:
React: Compatible with React 16.3 through React 19
Vue: Full support for Vue 3, with backward compatibility for Vue 2.6+
Preact: Works with Preact X (v10+) and older v8
Inferno: Supports v4 through v9
Angular: Compatible with Angular 14 through 19
Getting Started
Installation
# Using npm
npm install cerebral
# Using yarn
yarn add cerebral
# Using pnpm
pnpm add cerebral
Basic Example (React)
import React from 'react'
import { createApp } from 'cerebral'
import { Container, connect } from '@cerebral/react'
import { state, sequences } from 'cerebral'
// Create an action
const increment = ({ store, get }) => {
// Use 'store' to update state
store.set(state`count`, get(state`count`) + 1)
}
// Create app with state and sequences
const app = createApp({
state: {
count: 0
},
sequences: {
increment: [increment]
}
})
// Connect component to Cerebral
const Counter = connect(
{
count: state`count`,
increment: sequences`increment`
},
function Counter({ count, increment }) {
return (
<div>
<h1>Count: {count}</h1>
<button onClick={() => increment()}>Increment</button>
</div>
)
}
)
// Provide the app to your component tree
const App = () => (
<Container app={app}>
<Counter />
</Container>
)
For more detailed examples, check the documentation. If you prefer the proxy syntax (state.count instead of state`count`), see our proxy documentation.
Documentation
You can find the Cerebral documentation at cerebraljs.com.
Contribute
Cerebral is organized as a monorepo to make contributions easier:
Clone the repo:
git clone https://github.com/cerebral/cerebral.gitInstall dependencies:
npm install(from the root folder)
You don't need to run npm install in each package directory - the monorepo setup handles this for you.
Testing
Run all tests from the root directory:
npm test
Or run tests for a specific package:
# Navigate to the package
cd packages/cerebral
# Run tests for just this package
npm test
Making Changes
Create a branch for your changes
Make your code changes and add tests
Commit from the root using our guided format:
npm run commitPush your branch and create a pull request on GitHub
Using the monorepo for development
If you want to use your local Cerebral code in your own project, you can create symlinks to the packages:
# From your project root
ln -s ../../cerebral/packages/node_modules/cerebral/ node_modules/
ln -s ../../cerebral/packages/node_modules/@cerebral/ node_modules/
Remember to remove these links before installing from npm:
unlink node_modules/cerebral
unlink node_modules/@cerebral
Release process
Review and merge PRs into
nextbranch. It is safe to use "Update branch", the commit created by Github will not be part ofnexthistoryFrom command line:
git switch next
git pull
npm install # make sure any new dependencies are installed
npm run release -- --dry-run --print-release # and check release notes
git switch master
git pull
git merge --ff-only next
git push