Add drag-and-drop reordering to a React list without writing raw event handlers from scratch.
Show an offline warning banner in a React app using a single hook that watches network status.
Read and write browser localStorage in a React component with automatic state synchronization.
Build a geolocation feature that tracks the user's coordinates and updates a map in real time.
Some hooks require optional peer dependencies like RxJS or React Router, install only the ones you use.
Beautiful-react-hooks is a library of ready-to-use utility functions for React, the popular JavaScript tool for building web interfaces. In React, these utility functions are called "hooks," and they let you add specific behaviors to your components without writing the logic from scratch each time. This library collects dozens of them in one place, covering a wide range of common needs. The hooks in this collection handle things like responding to mouse movements, touch gestures, and swipe events, detecting whether the user is online or offline, reading and writing to browser storage (localStorage, sessionStorage, and cookies), working with the device's geolocation, handling drag-and-drop interactions, running timers and intervals, detecting dark mode, observing when elements scroll into view, and reading or updating URL query parameters. There are also hooks for speech recognition and speech synthesis if the browser supports those features. The intended audience is front-end developers working on React projects who want to avoid rewriting the same patterns in every codebase. The README describes the goal as speeding up development by providing a concise, consistent API that a team can share. Each hook is documented separately in its own file, and the repository includes a live playground where you can try them out in a browser without setting up a project. Installing the library requires Node.js and either npm or yarn. You add it to a project with a single install command, then import individual hooks by name. Some hooks depend on third-party packages like RxJS or React Router, those are listed as optional peer dependencies and only need to be installed if you use the specific hooks that rely on them. The project is MIT-licensed and accepts contributions. The README asks contributors to include tests and documentation for any new hook they submit.
← antonioru on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.