useHooks.iov4.1.2
DocsBlogGitHub
useHooks.io

Modern React Hooks

A collection of modern, server-safe React hooks with zero dependencies - install with our CLI tool

Install Hooks via CLI

Get started with a single commandnpx usehooks-cli@latest initnpx usehooks-cli@latest add use-array

Server-Safe

All hooks are built with React Server Components in mind and work seamlessly in modern React applications.

TypeScript First

Written in TypeScript with complete type definitions for the best developer experience.

Open Source

Free and open source under the MIT license. Contributions are welcome!

Performance Optimized

Lightweight and efficient hooks designed for optimal performance without compromising functionality.

Well Documented

Comprehensive documentation with examples, use cases, and best practices for every hook.

Community Driven

Built by developers, for developers. Join our growing community and help shape the future of React hooks.

Browse by Category

state

useArray

A hook providing helper methods for working with array state including push, pop, filter, sort, and other common operations

state

useCounter

A hook for managing counter state with increment, decrement, and reset

state

useIndexedDB

A hook for managing IndexedDB operations with React state

state

useLocalStorage

A hook for managing localStorage with React state

state

useProxy

A hook for creating and managing JavaScript Proxy objects with React state integration

state

useSet

A hook for managing and manipulating Set data structure with comprehensive methods for set operations, filtering, and state management

state

useToggle

A hook for managing toggle state with toggle and reset

state

sensors

useAudioRecorder

A comprehensive hook for audio recording with real-time analysis using getUserMedia, MediaRecorder, and Web Audio APIs

sensors

useBarcodeDetector

A hook for detecting barcodes and QR codes in images using the Barcode Detection API

sensors

useDeviceOrientation

A hook for accessing device orientation data using the DeviceOrientationEvent API

sensors

useGeolocation

A hook for accessing the Geolocation API to get user's location

sensors

useHover

A hook for detecting when an element is being hovered with optional callbacks and delay

sensors

useIsMobile

A hook for detecting mobile devices using media queries and user agent

sensors

useIsTablet

A hook for detecting tablet devices using media queries and user agent

sensors

useMediaSession

A hook for customizing media notifications and handling media control actions using the Media Session API

sensors

useNetworkInformation

A hook for accessing network connection information and monitoring network changes

sensors

useUserMedia

A hook for accessing camera and microphone using the getUserMedia API

sensors

useVibration

A hook for controlling device vibration using the Vibration API

sensors

browser

useBluetooth

A hook for interacting with Bluetooth Low Energy devices using the Web Bluetooth API

browser

useClipboard

A hook for interacting with the clipboard API to copy text content with state management

browser

useContactPicker

A hook for accessing the Contact Picker API to select contacts with user permission

browser

useStorage

A hook for managing browser storage quotas, usage estimation, and persistence using the Storage API

browser

useWebShare

A hook for sharing content using the Web Share API to access native sharing mechanisms

browser

utility

useClosure

A hook for creating and working with JavaScript closures, demonstrating closure concepts and patterns

utility

useDebounce

A hook for debouncing values to delay updates until after a specified delay period

utility

useIsMounted

A hook that returns whether the component is currently mounted

utility

usePrevious

A hook that returns the previous value of a state or prop

utility

useSymbol

A hook for creating and managing JavaScript Symbols with utilities for global registry and well-known symbols

utility

useThrottle

A hook for throttling values to limit updates to at most once per specified delay period

utility

useTimeout

A hook for managing timeouts with start, stop, and reset functionality

utility

lifecycle

useDeepCompareEffect

Like useEffect but with deep equality check for dependencies

lifecycle

useUpdateEffect

Like useEffect but skips the initial render

lifecycle

network

useFetch

A hook for making HTTP requests using the Fetch API with loading states and error handling

network

dom

useFullscreen

A hook for managing fullscreen mode using the Fullscreen API

dom

performance

useLazy

A hook for managing lazy-loaded React components with loading states, error handling, and preloading capabilities

performance

auth

useRoleGuard

A hook for role-based access control that redirects or hides content based on user roles

auth

Browser

useWindowSize

A hook that tracks the current window dimensions and updates on resize.

Browser
useHooks.io

Open Source and Free Forever

useHooks is open source and available under the MIT license. Feel free to use these hooks in your projects, contribute to the library, or share with the community.