react-use: Collection of React Hooks
Pre-built hooks wrapping browser APIs and common patterns.
Learn more about React Use
react-use is a React Hooks library that provides pre-built hooks for managing state and side effects in functional components. The library wraps browser APIs and common patterns into composable hooks, allowing developers to handle sensor data, DOM measurements, keyboard input, and navigation state. It covers a broad range of use cases from device battery tracking to scroll position monitoring to media query detection. The hooks are designed to integrate directly into React functional components without requiring class-based wrappers or higher-order components.
Comprehensive sensor coverage
Provides hooks for accessing device APIs including battery status, geolocation, motion sensors, media devices, and network state. This allows functional components to directly consume hardware and browser sensor data.
DOM and layout tracking
Includes hooks for monitoring element measurements, scroll positions, intersection state, and hover status. Components can respond to layout changes and user interactions without manual event listener management.
Port of libreact patterns
The library adapts patterns from the libreact project to React Hooks, providing a migration path for developers familiar with that API while leveraging modern React functional component patterns.
import React from 'react';
import { useMouse } from 'react-use';
function MouseTracker() {
const ref = React.useRef(null);
const { docX, docY } = useMouse(ref);
return (
<div ref={ref}>
Mouse position: {docX}, {docY}
</div>
);
}Top in Frontend
Related Repositories
Discover similar tools and frameworks used by developers
Excalidraw
React canvas library with encrypted collaborative drawing.
Tailwind CSS
PostCSS framework generating utility classes from scanned templates.
next.js
File-based React framework with hybrid rendering strategies.
TanStack Table
Framework-agnostic headless table library for building datagrids.
chenyuluoyan_thin
Thin-weight Chinese font family for modern digital interfaces with graceful readability.
Related Reading
Guides and comparisons from the Greptile content library
Best AI Coding Tools for Solo Developers (2026 Review)
The best AI coding tools for solo developers in 2026, compared by where they fit in the software development lifecycle: writing code, prototyping, reviewing, testing, and background automation. Plus which tools fit which languages.
How to Evaluate Code Review Tools: The 4 Step Framework
A 4-step framework for evaluating code review tools on large teams with complex codebases: define what you need, build a shortlist, run a live test, and get developer feedback. Plus a shortlist of tools and how to future-proof your review process.
27 Code Quality Tools that Catch Bugs [2026 Review]
The best code quality tools that catch bugs, security vulnerabilities, and runtime errors, sorted by language, with type, noise level, cost, and who each one is for.
What is a sandbox environment? Everything you need to know
A sandbox is an isolated, disposable environment where code can run without touching anything else. Learn how sandboxes work, what teams use them for, how to set one up, and why they matter more now that agents write so much of the code.