Valtio
UI library · Free
Manages JavaScript state through proxies and snapshots: lets you modify objects normally and subscribe React components to changes.
Also known as: pmndrs/valtio; valtio; valtio-state; pmndrs-valtio

What you can use for free
Code and local use under MIT.
Paid features and costs
Computing resources, self-hosting, and external services are paid for separately if used.
Access and limitations
Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.
Use cases
- Update a shared state object through a proxy
- Connect snapshots to React UI and check its response to changes
Example workflow
A possible workflow; this is not a report of hands-on testing.
Update a shared state object through a proxy.
Before you start
- The component's design, states, and data.
- A compatible framework and the project's styles.
Steps
- Describe proxy state and permitted changes to its fields.
- Connect snapshots to React UI and check its response to changes.
- Configure styles and check empty, loading, and error states.
Check your result
- The keyboard, focus indicators, and a screen reader let users complete the action.
- The component works on a narrow screen and with long data values.
Choosing Valtio
Update a shared state object through a proxy
Choose this when
- Update a shared state object through a proxy
- Connect snapshots to React UI and check its response to changes
Consider alternatives when
- When choosing for this topic, compare Valtio with Immer. A candidate to compare under the topic: Design systems, UI components. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- When choosing for this topic, compare Valtio with Jotai. A candidate to compare under the topic: Design systems, UI components. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
Requirements
- For Valtio v2 with React, the README specifies React 18+. subscribe returns an unsubscribe function.
Things to consider
- Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
- Terms of use: MIT for the code; dependencies have separate licenses.
- A snapshot is deeply readonly: a method using this cannot change frozen state when called on a snapshot. The README also notes a useTransition limitation when async data is consumed through use.
Frequently asked questions
What can you use for free in Valtio?
Code and local use under MIT.
What additional costs might arise with Valtio?
Computing resources, self-hosting, and external services are paid for separately if used.
What terms of use matter for Valtio?
MIT for the code; dependencies have separate licenses.
How do you get started with Valtio?
Describe proxy state and permitted changes to its fields. Connect snapshots to React UI and check its response to changes. Configure styles and check empty, loading, and error states.
Where should you read and update Valtio state?
proxy tracks object changes. Read useSnapshot during React render and modify the original proxy in handlers; useSnapshot tracks the properties being used. For plain JavaScript, proxy, subscribe, and snapshot are available from valtio/vanilla.
Related tasks and approaches
- Immer
A candidate to compare under the topic: Design systems, UI components. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- Jotai
A candidate to compare under the topic: Design systems, UI components. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- Zustand
A candidate to compare under the topic: Design systems, UI components. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
License
MIT for the code; dependencies have separate licenses.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsTechnologies and topics
- Valtio
- UI
- Development