Hooks reference
Browse every public Rooks hook by category, entrypoint, status, and supported alias.
This reference is built from the same public API manifest as the package barrels and README. Canonical implementations and supported aliases are counted and rendered from that manifest.
Use global search for a hook name or alias. Each canonical page shows its exact TypeScript signature, import path, status, aliases, category, and related hooks from the shared manifest.
147 canonical hook implementations and 3 supported aliases, derived from the current package exports.
Animation & Timing
10 hooksDeprecated progress animation hook; use useEasing for new code.
Creates a controllable eased animation progress value.
Runs the latest callback on an interval while a condition is true.
Sets document.body overflow to hidden while a condition is true.
Tracks the user's prefers-reduced-motion media setting.
Runs the latest callback every animation frame while active.
Observes the size of the element attached to a callback ref.
Animates a number toward a target with a basic damped spring simulation.
Runs the latest callback once after a delay while a condition remains true.
Animates an eased progress value from zero to one.
Browser APIs
16 hooksEnables cross-tab/window communication via the BroadcastChannel API.
Reads from and writes to the clipboard using the Clipboard API.
Hook for fetching data from URLs with loading states, error handling, and automatic JSON parsing
Tracks the user's geographic location using the Geolocation API.
Detects when the user is idle using the IdleDetection API.
Records audio/video streams using the MediaRecorder API.
Returns the user's preferred language from the Navigator API.
Exposes network connectivity and speed information from the Network Information API.
Requests permission and sends desktop notifications via the Notifications API.
Tracks the browser's navigator.onLine connectivity hint.
Returns the current screen orientation and listens for orientation changes.
Provides details about the user's screens using the Screen Details API.
Triggers the native Web Share dialog to share content from the browser.
Converts text to speech using the Web Speech API.
Triggers device vibration patterns using the Vibration API.
Coordinates asynchronous resource access using the Web Locks API.
Development & Debugging
2 hooksEvent Handling
17 hooksAttaches a document event listener and removes it when the component unmounts.
Returns the document visibility state and updates when it changes.
Provides focus and blur props for an element's own focus boundary.
Provides focus props that track entry to and exit from an element subtree.
Reports whether files are being dragged over an element or the window.
Returns a ref that handles native click and touch-end events.
Returns a ref that handles native mouse-enter and mouse-leave events.
Calls a callback after an element remains hovered for a duration.
Also exported as useOnLongHoverRef
Calls a callback after an element remains pressed for a duration.
Also exported as useOnLongPressRef
Calls a callback for allowed typing keys outside editable elements.
Calls a callback for passive window resize events.
Calls a callback for passive window scroll events.
Calls a handler for click or touch-start events outside an object ref.
Returns a ref and calls a handler for click or touch-start events outside it.
Calls a callback for unload, page-hide, and hidden-document signals.
Returns the current text selection for the document or a target element.
Attaches a window event listener and removes it when the component unmounts.
Form & File Handling
3 hooksKeyboard & Input
5 hooksReturns controlled input value and change props with optional validation.
Calls a callback when any configured keyboard identifier matches an event.
Maps independent keyboard identifiers to their callbacks.
Returns a callback ref that handles matching keyboard events on an element.
Calls a callback when every key in a configured combination is pressed.
Lifecycle & Effects
11 hooksRuns asynchronous effect work with a current-generation guard and optional cleanup.
Starts only the latest asynchronous effect after a debounce window.
Delays an effect until its dependencies stop changing.
Runs an effect when a dependency array changes by deep equality.
Runs a callback from an effect when a component mounts.
Runs a callback after updates while skipping the initial mount.
Updates document.title and can restore its original value during cleanup.
Runs the latest callback once when a condition first becomes true.
Uses a layout effect in the browser and a passive effect during server rendering.
Logs a component's mount, update, and unmount lifecycle to the console.
Runs the initial callback as an effect cleanup when a component unmounts.
Mouse & Touch
3 hooksPerformance & Optimization
5 hooksReturns a stable Lodash-style debounced wrapper around the latest callback.
Returns a value that follows its input after a delay, plus an immediate setter.
Debounces a callback and reports whether its timeout window is active.
Executes a callback immediately at most once per timeout window.
Creates and manages a classic Web Worker with message, status, and error state.
State Management
19 hooksManages an array state with helper methods for push, pop, splice, sort, and more.
Counts the intervals remaining until a target Date and reports progress or completion.
Manages a numeric counter with increment, decrement, and reset operations.
Returns a function that reports whether the component is currently mounted.
Persists React state in localStorage and synchronizes matching hook instances.
Manages a record-like object as React state with keyed update and removal helpers.
Also exported as useObjectState
Manages multiple-selection list state with toggle and select-all helpers.
Manages a native Map object in React state with reactive update helpers.
Returns the most recent previous value that was different from the current one.
Returns the previous value of a variable immediately after it changes.
Tracks the status and result of a Promise (pending, resolved, or rejected).
Manages queue (FIFO) state with enqueue, dequeue, and peek operations.
Updates React state on each requestAnimationFrame tick.
Calls setState only if the component is still mounted, preventing memory leaks.
Manages a selection state from a list of options with helpers.
Manages a single-selection list state with toggle and clear helpers.
Persists React state in sessionStorage and synchronizes matching hook instances.
Manages a Set data structure as React state with add, delete, and clear helpers.
Manages stack (LIFO) state with push, pop, and peek operations.
State History & Time Travel
4 hooksManages state with undo, redo, and navigation across its complete history.
Toggles a boolean or applies a custom reducer to another state type.
Manages state with bounded undo and redo history.
Manages state with a bounded, one-directional undo history.
UI & Layout
14 hooksControls an audio element while exposing playback, loading, timing, volume, rate, loop, and error state.
Reads an element's DOMRect after mount and whenever the observed DOM subtree mutates.
Supplies a callback ref, its current DOMRect, and a manual measurement function.
Measures an attached div after layout and optionally on window resize and scroll.
Enters, exits, and tracks Fullscreen API state for the document or a target element.
Returns a callback ref that forwards IntersectionObserver notifications to the latest callback.
Returns a callback ref and whether its element currently intersects an observer root.
Measures client, offset, and scroll dimensions with ResizeObserver and optional debouncing.
Subscribes to a CSS media query with a deterministic server-rendered fallback.
Observes mutations on the element in an existing object ref and cleans up automatically.
Returns a callback ref that observes DOM mutations on its current element.
Detects, enters, exits, and tracks standard Picture-in-Picture state for a video element.
Tracks the user's light, dark, or no-preference color-scheme media setting.
Supplies a video ref with playback, timing, mute, volume, seeking, and fullscreen controls.
Utilities & Refs
7 hooksReturns a callback ref that manages an event listener on its current HTML element.
Sends one ref value to two mutable or callback refs.
Returns a stable function that delegates to the latest callback after effects run.
Keeps the latest committed value in a stable mutable ref.
Returns a function that invokes the latest void callback after effects run.
Sends one ref value to any number of mutable or callback refs.
Exposes a callback ref together with the element currently attached to it.
Window & Viewport
2 hooksExperimental Hooks
25 hooksManages async disposable resources using the TC39 Explicit Resource Management proposal.
Prompt before the page unloads when a guard passes.
Persist React state in browser cookies with same-document synchronization.
Manages synchronous disposable resources using the TC39 Explicit Resource Management proposal.
Strongly typed event-listener primitive for browser EventTargets.
Tell whether the component has mounted on the client.
Track whether one or more keyboard keys are currently pressed.
Read the current location hash, including the leading #.
Read the first value for a specific search parameter.
Read the current browser location as a stable snapshot.
Enumerate and refresh available media input and output devices.
Query and optionally watch browser permission state.
Generic promise-request lifecycle hook with retries, polling, and mutation.
Track a named set of media queries and compute the current breakpoint.
Load and share external script state across multiple consumers.
Track an element's scroll offsets and scrollable bounds.
Measure an element with ResizeObserver using a callback ref.
Loads a favicon and suspends the component until the resource is ready.
Reads and writes IndexedDB state with Suspense support.
Reads and writes localStorage state with Suspense support.
Reads battery status from the Battery API with Suspense support.
Reads User-Agent Client Hints with Suspense support.
Reads and writes sessionStorage state with Suspense support.
Render a fixed-size virtual list with ready-to-use item styles.
Manage a WebSocket connection with parsing, sending, and reconnection helpers.
Temporal Hooks
4 hooksCalculates calendar age from a date and updates at each local day boundary.
Counts down to a Temporal instant and stops when the target is reached.
Measures elapsed time from an instant and updates on aligned boundaries.
Returns the current time as a Temporal value and updates on aligned time boundaries.
Stable categories
- State Management
- State History & Time Travel
- Lifecycle & Effects
- Event Handling
- Keyboard & Input
- Mouse & Touch
- Window & Viewport
- UI & Layout
- Browser APIs
- Form & File Handling
- Animation & Timing
- Performance & Optimization
- Utilities & Refs
- Development & Debugging
Separate entrypoints
- Temporal: four stable hooks imported from
rooks/temporal; read the Temporal guide first. - Experimental: hooks imported from
rooks/experimental; read the experimental stability guide before production use.
Supported aliases
| Alias | Canonical documentation |
|---|---|
useObjectState | useMapState |
useOnLongHoverRef | useOnLongHover |
useOnLongPressRef | useOnLongPress |
The alias names refer to the same implementations; they do not have duplicate reference pages. Internal source helpers are excluded from this index.