Nanostores screenshot

Nanostores

Author Avatar Theme by Nanostores
Updated: 19 Dec 2025
6975 Stars

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

Categories

Overview:

Nano Stores is a tiny state manager that can be used with various JavaScript frameworks like React, React Native, Preact, Vue, Svelte, Solid, Lit, Angular, and vanilla JS. It is designed to move logic from components to stores, making applications more efficient and manageable. Nano Stores is small in size, with a minified and gzipped size between 298 and 1013 bytes. It has zero dependencies and uses Size Limit to control its size. With small atomic and derived stores, Nano Stores offers fast performance without the need to call the selector function for all components on every store change. It is also tree-shakable, meaning that a chunk only contains the stores used by components in the chunk. Nano Stores has good TypeScript support and is developed by Evil Martians, a product consulting company specializing in developer tools.

Features:

  • Smart Stores: Nano Stores provides various smart stores such as a persistent store to save data to localStorage and synchronize changes between browser tabs, a router store to parse URLs and implement single-page application (SPA) navigation, an I18n library based on stores for making applications translatable, and a query store that helps with smart remote data fetching. It also includes Logux Client, which provides stores with WebSocket sync and conflict resolution using CRDT (Conflict-free Replicated Data Types).
  • Devtools: Nano Stores offers devtools for easy debugging. It includes a logger of lifecycles, changes, and actions in the browser console. It also provides a Vue Devtools plugin that detects stores and attaches them to devtools inspectors and timeline.
  • Guide: Nano Stores has a comprehensive guide that explains different store types and how to use them. It covers topics like atoms, maps, deep maps, lazy stores, and more. The guide provides examples and code snippets to help developers understand how to work with Nano Stores.
  • Integration: Nano Stores can be integrated with various JavaScript frameworks, including React, Preact, Vue, Svelte, Solid, Lit, Angular, and vanilla JS. The integration guides provide instructions and code snippets for each framework to help developers get started with Nano Stores.
  • Server-Side Rendering: Nano Stores supports server-side rendering, allowing stores to be initialized on the server and then synchronized with the client. This ensures consistent state across server and client.
  • Tests: Nano Stores provides best practices and guidelines for testing applications using Nano Stores. It covers unit testing, integration testing, and end-to-end testing with different testing libraries and tools.

Installation:

To install Nano Stores, you can use npm or yarn:

npm install nano-stores

or

yarn add nano-stores

Once installed, you can import and start using Nano Stores in your project.

Summary:

Nano Stores is a lightweight and versatile state manager that can be used with various JavaScript frameworks. It offers smart stores for managing different aspects of an application, including persistence, routing, internationalization, and remote data fetching. With its small size and fast performance, Nano Stores is a powerful tool for improving the efficiency and manageability of applications. Its comprehensive guide and integration guides provide developers with the necessary resources to get started and make the most of Nano Stores. Overall, Nano Stores is a valuable asset for developers looking to optimize their application state management.