Gathering detailed insights and metrics for mobx-state-tree
Gathering detailed insights and metrics for mobx-state-tree
Gathering detailed insights and metrics for mobx-state-tree
Gathering detailed insights and metrics for mobx-state-tree
mobx-keystone
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
mobx-devtools-mst
Allows debugging mobx-state-tree roots. See [mobx-devtools/README.md](https://github.com/mobxjs/mobx-devtools/blob/master/README.md#mobx-state-tree).
@cerebral/mobx-state-tree
Combine Cerebral with Mobx state tree
proxy-state-tree
An implementation of the Mobx/Vue state tracking approach, for library authors
Full-featured reactive state management without the boilerplate
npm install mobx-state-tree
Typescript
Module System
Node Version
NPM Version
98.4
Supply Chain
96.5
Quality
86.5
Maintenance
100
Vulnerability
100
License
TypeScript (98.54%)
JavaScript (1.36%)
HTML (0.04%)
CSS (0.04%)
Dockerfile (0.02%)
Shell (0.01%)
Total Downloads
21,581,292
Last Day
3,470
Last Week
92,628
Last Month
409,911
Last Year
4,688,790
MIT License
7,030 Stars
2,355 Commits
643 Forks
89 Watchers
30 Branches
234 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
7.0.2
Package Id
mobx-state-tree@7.0.2
Unpacked Size
1.23 MB
Size
231.17 kB
File Count
48
NPM Version
10.8.2
Node Version
20.18.0
Published on
Feb 17, 2025
Cumulative downloads
Total Downloads
Last Day
-13.9%
3,470
Compared to previous day
Last Week
-7.2%
92,628
Compared to previous week
Last Month
-4.7%
409,911
Compared to previous month
Last Year
8%
4,688,790
Compared to previous year
1
1
26
Technically speaking, mobx-state-tree (also known as MST) is a state container system built on MobX, a functional reactive state library.
This may not mean much to you, and that’s okay. I’ll explain it like this: MobX is a state management "engine", and MobX-State-Tree gives it structure and common tools you need for your app. MST is valuable in a large team but also useful in smaller applications when you expect your code to scale rapidly. And if we compare it to Redux, MST offers better performance and much less boilerplate code than Redux!
MobX is one of the most popular Redux alternatives and is used (along with MobX-State-Tree) by companies worldwide. MST plays very well with TypeScript, React, and React Native, especially when paired with mobx-react-lite. It supports multiple stores, async actions and side effects, enables extremely targeted re-renders for React apps, and much more -- all in a package with zero dependencies other than MobX itself.
Note: you don't need to know how to use MobX in order to use MST.
See the Getting started tutorial or follow the free egghead.io course.
👉 Official docs can be found at http://mobx-state-tree.js.org/
There's nothing quite like looking at some code to get a feel for a library. Check out this small example of an author and list of tweets by that author.
1import { types } from "mobx-state-tree" // alternatively: import { t } from "mobx-state-tree" 2 3// Define a couple models 4const Author = types.model({ 5 id: types.identifier, 6 firstName: types.string, 7 lastName: types.string 8}) 9const Tweet = types.model({ 10 id: types.identifier, 11 author: types.reference(Author), // stores just the `id` reference! 12 body: types.string, 13 timestamp: types.number 14}) 15 16// Define a store just like a model 17const RootStore = types.model({ 18 authors: types.array(Author), 19 tweets: types.array(Tweet) 20}) 21 22// Instantiate a couple model instances 23const jamon = Author.create({ 24 id: "jamon", 25 firstName: "Jamon", 26 lastName: "Holmgren" 27}) 28 29const tweet = Tweet.create({ 30 id: "1", 31 author: jamon.id, // just the ID needed here 32 body: "Hello world!", 33 timestamp: Date.now() 34}) 35 36// Now instantiate the store! 37const rootStore = RootStore.create({ 38 authors: [jamon], 39 tweets: [tweet] 40}) 41 42// Ready to use in a React component, if that's your target. 43import { observer } from "mobx-react-lite" 44const MyComponent = observer((props) => { 45 return <div>Hello, {rootStore.authors[0].firstName}!</div> 46}) 47 48// Note: since this component is "observed", any changes to rootStore.authors[0].firstName 49// will result in a re-render! If you're not using React, you can also "listen" to changes 50// using `onSnapshot`: https://mobx-state-tree.js.org/concepts/snapshots
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 17/30 approved changesets -- score normalized to 5
Reason
2 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More