# nanostores

> A tiny (372 bytes) state manager for React/Preact/Vue/Svelte with many atomic tree-shakable stores

Latest version **1.5.3** (published 2026-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install nanostores
pnpm add nanostores
yarn add nanostores
bun add nanostores
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.3 |
| Published | 2026-09-02 |
| First published | 2021-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^20.0.0 \|\| >=22.0.0 |
| Dependencies | 0 |
| Unpacked size | 52.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7606 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | preact, react, react native, state, state manager, store, svelte, vue |

## Links

- npm: https://www.npmjs.com/package/nanostores
- Repository: https://github.com/nanostores/nanostores
- Homepage: https://github.com/nanostores/nanostores#readme
- Issues: https://github.com/nanostores/nanostores/issues
- Funding: https://github.com/sponsors/ai
- npm.io page: https://npm.io/package/nanostores

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.5.3 (latest) — 2026-09-02
- 1.5.2 — 2026-08-20
- 1.5.1 — 2026-08-17
- 1.5.0 — 2026-08-15
- 1.4.2 — 2026-07-29
- 1.4.1 — 2026-07-20
- 1.4.0 — 2026-06-27
- 1.3.0 — 2026-04-17
- 1.2.0 — 2026-03-14
- 1.1.1 — 2026-02-25
- 1.1.0 — 2025-11-19
- 1.0.1 — 2025-04-10
- 1.0.0 — 2025-04-10
- 0.11.4 — 2025-02-14
- 0.11.3 — 2024-08-26
- … 49 more at https://npm.io/package/nanostores/versions

## README

# Nano Stores

<img align="right" width="92" height="92" title="Nano Stores logo"
     src="https://nanostores.github.io/nanostores/logo.svg">

A tiny state manager for **React**, **React Native**, **Preact**, **Vue**,
**Svelte**, **Solid**, **Lit**, **Angular**, and vanilla JS.
It uses **many atomic stores** and direct manipulation.

- **Small.** Between 372 and 912 bytes (minified and brotlied).
  Zero dependencies. It uses [Size Limit] to control size.
- **Fast.** With small atomic and derived stores, you do not need to call
  the selector function for all components on every store change.
- **Tree Shakable.** A chunk contains only stores used by components
  in the chunk.
- Designed to move logic from components to stores.
- Good **TypeScript** support.

```ts
// store/users.ts
import { atom } from 'nanostores'

export const $users = atom<User[]>([])

export function addUser(user: User) {
  $users.set([...$users.get(), user])
}
```

```ts
// store/admins.ts
import { computed } from 'nanostores'
import { $users } from './users.ts'

export const $admins = computed($users, users => users.filter(i => i.isAdmin))
```

```tsx
// components/admins.tsx
import { useStore } from '@nanostores/react'
import { $admins } from '../stores/admins.ts'

export const Admins = () => {
  const admins = useStore($admins)
  return (
    <ul>
      {admins.map(user => (
        <UserItem user={user} />
      ))}
    </ul>
  )
}
```

---

<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Nano Stores is built by <b><a href="https://evilmartians.com/">Evil Martians</a></b>, an American design and engineering consultancy for <b>developer tools, AI, and cybersecurity startups</b>.

---

[Size Limit]: https://github.com/ai/size-limit

## Docs
Read full docs **[here](https://github.com/nanostores/nanostores#readme)**.

---
_Source: https://npm.io/package/nanostores · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
