react-use bundles many React hooks for state, browser sensors, effects, and UI behavior. It is a port of the libreact hook set and installs from npm.
Overview
react-use gathers hooks that solve recurring front-end tasks in React applications. Hooks are grouped by concern: reading device and browser state, managing UI interactions, running timed or animated updates, handling side effects, and sharing state across components.
Sensor-style hooks cover geolocation, media queries, keyboard input, scroll position, network status, pointer gestures, and similar signals. UI hooks handle clicks outside elements, drag-and-drop, fullscreen, sliders, and video playback. Side-effect helpers include async execution, cookies, local and session storage, debouncing, and throttling.
Factory helpers create custom reducers, memoized hooks, and global or context-backed state. The package is intended as a grab bag you import selectively rather than a single framework. Interactive docs list individual hooks with demos.
Key features
- Browser and device sensor hooks
- Scroll and pointer tracking
- Debounced and throttled callbacks
- Local and session storage helpers
- Async and lifecycle utilities
- Global and shared state factories
- Animation and interval hooks
- Fullscreen and media controls
Use cases
- Reading viewport and input state
- Persisting UI preferences
- Building interactive dashboards
- Prototyping hook-driven behavior