React Utility Library

Production-grade hooks for real React apps

Reactilities delivers 52+ hooks, lifecycle helpers, utility functions, and TypeScript types to speed up development without sacrificing quality. SSR safe. Tree-shakable. Zero runtime dependencies (besides React).

69+

React hooks

99%+

Test coverage

0

Runtime deps

TS First

Full typings

Quick Start

Install in 10 seconds

npm install reactilities

Why Reactilities

Built for teams shipping fast

Comprehensive API

DOM hooks, state hooks, async utilities, lifecycle helpers, and utility types in one package.

SSR Safe by Design

Hooks guard browser-only APIs to avoid server-side rendering crashes and hydration mismatches.

TypeScript First

Strong types, generics, and IntelliSense make integrations predictable in strict mode projects.

Tree-Shakable

Import exactly what you need and keep bundle size under control.

Well Tested

99%+ coverage reduce regression risk and increase confidence in production.

Zero External Runtime Dependencies

Only React peer dependencies, no extra runtime baggage.

Live Playground

Interactive demos powered by real hooks

These examples run with reactilities imported from dependencies, so visitors can feel real behavior before reading the docs.

Loading demos...

Interactive demos are loading on the client.

API Explorer

Browse every hook and utility

78 entries

DOM

useBattery

Monitor battery level and charging status

Read docs →
DOM

useDarkMode

Dark mode with system preference detection and persistence

Read docs →
DOM

useDocumentTitle

Dynamically update the document title

Read docs →
DOM

useEventListener

Add event listeners with automatic cleanup

Read docs →
DOM

useFocusTrap

Trap keyboard focus within a container

Read docs →
DOM

useFullscreen

Enter, exit, and track fullscreen state

Read docs →
DOM

useLockBodyScroll

Prevent body scrolling for modals and overlays

Read docs →
DOM

useLongPress

Detect long press and hold interactions

Read docs →
DOM

useMediaQuery

Responsive behavior with CSS media queries

Read docs →
DOM

useOrientation

Track portrait/landscape device orientation

Read docs →
DOM

usePageVisibility

Detect when the browser tab is hidden or visible

Read docs →
DOM

usePortal

Create a portal root mounted to document.body

Read docs →
DOM

useRovingTabIndex

Accessible keyboard navigation for item groups

Read docs →
DOM

useScrollTo

Programmatic scrolling helpers for page and elements

Read docs →
STATE

useBoolean

Boolean state with setTrue and setFalse helpers

Read docs →
STATE

useClipboard

Read and write clipboard content with status helpers

Read docs →
STATE

useCopyToClipboard

Copy text to clipboard with fallback

Read docs →
STATE

useCounter

Numeric counter with min/max bounds and step

Read docs →
STATE

useList

Manage array state with rich helper actions

Read docs →
STATE

useLocalStorage

Persist state in localStorage with sync

Read docs →
STATE

useObjectState

Manage object state with partial updates

Read docs →
STATE

useSessionStorage

Persist state in sessionStorage

Read docs →
STATE

useToggle

Toggle boolean state with flexible API

Read docs →
UTILITY

useAsync

Manage async operations with loading and error state

Read docs →
UTILITY

useAutoSave

Auto-save changing data with status tracking

Read docs →
UTILITY

useCountdown

Countdown or count-up timer with controls

Read docs →
UTILITY

useDebounceCallback

Debounce callback execution

Read docs →
UTILITY

useDragAndDrop

File drag-and-drop handling with validation

Read docs →
UTILITY

useEventSource

Manage server-sent events (SSE) streams

Read docs →
UTILITY

useFetch

Data fetching with automatic abort support

Read docs →
UTILITY

useFileReader

Read files as text, data URL, or ArrayBuffer

Read docs →
UTILITY

useIdleTimeout

Detect user inactivity with timeout callbacks

Read docs →
UTILITY

useImageLazyLoad

Lazy-load images when they enter viewport

Read docs →
UTILITY

useInfiniteScroll

Infinite scrolling with IntersectionObserver

Read docs →
UTILITY

useIsMounted

Guard async updates against unmounted components

Read docs →
UTILITY

useIntersectionObserver

Detect element visibility

Read docs →
UTILITY

useKeyboardShortcuts

Handle keyboard shortcuts

Read docs →
UTILITY

useLogger

Log component lifecycle and prop changes

Read docs →
UTILITY

usePermission

Query browser permission status reactively

Read docs →
UTILITY

useSpeechRecognition

Capture voice input with Web Speech API

Read docs →
UTILITY

useSpeechSynthesis

Text-to-speech controls with voice selection

Read docs →
UTILITY

useThrottleCallback

Throttle callback execution

Read docs →
UTILITY

useTimeout

Run callback after delay with reset and clear

Read docs →
UTILITY

useVirtualization

Virtualize large lists for performance

Read docs →
UTILITY

useWhyDidYouRender

Debug unnecessary re-renders in development

Read docs →
LIFECYCLE

componentDidMount

Run function after component mounts

Read docs →
LIFECYCLE

componentDidUpdate

Run function after every render

Read docs →
LIFECYCLE

componentWillMount

Run function before first render

Read docs →
LIFECYCLE

componentWillUnmount

Run cleanup before unmount

Read docs →
LIFECYCLE

useIsomorphicLayoutEffect

SSR-safe drop-in for useLayoutEffect

Read docs →
LIFECYCLE

useUpdateEffect

useEffect variant that skips first render

Read docs →
TYPES

ValueOf<T>

Extract all possible values from an object

Read docs →
TYPES

DeepPartial<T>

Recursively make all properties optional

Read docs →
TYPES

VoidFunction<T>

Type for void-returning typed functions

Read docs →

SEO Index

Complete hook and utility index

Full text index for search engines and quick scanning by developers.

DOM Hooks (21)

useBattery, useClickOutside, useDarkMode, useDocumentTitle, useEventListener, useFavicon, useFocusTrap, useFullscreen, useHover, useLockBodyScroll, useLongPress, useMediaQuery, useMousePosition, useOrientation, usePageVisibility, usePortal, useResizeObserver, useRovingTabIndex, useScrollPosition, useScrollTo, useWindowSize

State Hooks (15)

useBoolean, useClipboard, useCookie, useCopyToClipboard, useCounter, useList, useLocalStorage, useMap, useObjectState, usePrevious, useSessionStorage, useSet, useStep, useToggle, useUndoRedo

Utility Hooks (29)

useAsync, useAutoSave, useCountdown, useDebounce, useDebounceCallback, useDragAndDrop, useEventSource, useFetch, useFileReader, useGeolocation, useIdleTimeout, useImageLazyLoad, useInfiniteScroll, useIntersectionObserver, useInterval, useIsMounted, useKeyboardShortcuts, useLogger, useNetworkState, usePermission, useSpeechRecognition, useSpeechSynthesis, useThrottle, useThrottleCallback, useTimeout, useVirtualization, useWebSocket, useWhyDidYouRender, useWorker

Lifecycle Hooks (6)

componentDidMount, componentDidUpdate, componentWillMount, componentWillUnmount, useIsomorphicLayoutEffect, useUpdateEffect

Helper Functions (2)

classnames, loadScript

TypeScript Types (5)

Nullable<T>, Maybe<T>, ValueOf<T>, DeepPartial<T>, VoidFunction<T>

FAQ

Common questions

Is Reactilities SSR compatible?

Yes. Hooks are implemented with SSR guards for browser APIs to avoid runtime crashes during server rendering.

Does it work with TypeScript strict mode?

Yes. The package is TypeScript-first and ships with complete type definitions, including utility generic types.

Can I import only specific hooks?

Yes. Reactilities is tree-shakable, so modern bundlers remove unused exports.