Rooks - Open source Custom hooks in React

Bhargav Ponnapalli

What Is Rooks?

Rooks is a comprehensive collection of custom React hooks—over 99 of them—designed to enhance component development with easy-to-use abstractions. It supports CommonJS, UMD, and ESM formats and is fully written in TypeScript with built-in declarations npm.
As of August 26, 2025, the latest release is rooks@9.0.1 GitHub. I update it regularly.

What Makes Rooks Useful?

Breadth of Hooks: Rooks offers hooks spanning animation (useIntervalWhen, useTimeoutWhen), browser APIs (useGeolocation, useOnline, useNavigatorLanguage), UI behaviors (useLockBodyScroll), event listeners, lifecycle helpers, and more npmmadewithreactjs.com.
Tree-Shakable Design: You can install just specific hooks (e.g., @rooks/use-geolocation), or the entire bundle—and your build will only include the hooks you actually use npm+1.
Saves You From Rebuilding Common Patterns: Instead of writing your own usePrevious, useToggle, or useOutsideClick, you can import them directly from Rooks—reducing boilerplate and focusing on core logic.
Real-World Use Cases: For instance, the useKeys hook makes it trivial to trigger actions on specific key sequences—like implementing an Easter egg that shows an alert when "QWERTY" is pressed DEV Community.
Community Recognition: Developers appreciate it as a solid alternative to other options like react-use; one Reddit user noted encountering Rooks as their go-to utility hook library Reddit.

Motivation Behind Rooks

Empowering Productivity: I wanted to create a curated, reliable set of hooks that solve common—but often tricky—problems, so developers don’t waste time reinventing the wheel.
Quality Over Quantity: Instead of piling on countless hooks that risk being buggy or stale, my focus with Rooks has always been on building a stable, well-tested toolkit.
Flexibility & Performance: I designed Rooks to work both as granular, standalone hook packages and as a full bundle. That way, developers get the convenience of choice without compromising on bundle size.
Type Safety & Modern Standards: By building everything with TypeScript and ensuring compatibility across module systems, I made sure Rooks works seamlessly with modern React development practices.
Encouraging Best Practices: My goal was also to promote better coding habits—Rooks’ higher-level hooks help developers avoid common pitfalls with low-level hooks like useEffect, leading to cleaner, more declarative, and maintainable code.

Summary

Rooks is my effort to assemble a robust, thoughtfully organized collection of React hooks. I built it so you can drop in powerful, reusable abstractions—whether for managing intervals, detecting visibility, handling user input, or more—without having to craft them from scratch. The design prioritizes modularity, type safety, and performance, giving you flexibility in how you import and bundle. Ultimately, I want Rooks to be a dependable toolbox that lets developers move faster, write cleaner code, and avoid common pitfalls in the React hooks landscape.
Like this project

Posted Jun 8, 2022

Rooks is a comprehensive collection of custom React hooks—over 99 of them—designed to enhance component development with easy-to-use abstractions.

Delightful React Ebook
Delightful React Ebook
Postal Recall
Postal Recall
Nextbase SaaS boilerplate
Nextbase SaaS boilerplate

Join 50k+ companies and 1M+ independents

Contra Logo

© 2025 Contra.Work Inc