react-values is a lightweight React utility library that gives developers a set of tiny, composable components for managing state with a render-props API, so you don’t need to rewrite the same state logic over and over in your UI components. It exposes helpful state transforms like toggle, increment, filter, and native methods matching JavaScript value types (Array, Boolean, Number, Object, String, Map, Set, Date), which makes it easier to implement common behaviors like toggles, counters, and filtering right out of the box. Instead of forcing you into a specific global state system or hooks-only interface, it uses render props to keep components flexible and visible in the tree, enabling controlled and uncontrolled use cases alongside shared state patterns. The design prioritizes simplicity and familiarity, so working with values feels like using native JavaScript methods but with UI reactivity built in, helping you avoid boilerplate.
Features
- Tiny composable React components for state
- Render-props API exposing state and controls
- Helpers for Boolean, Number, String, Object, Array, Map, Set, Date
- Encourages reuse of common state patterns
- Controlled and uncontrolled component support
- Light footprint and easy to reason about