Rooks
Hooks

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 hooks

Browser APIs

16 hooks

Development & Debugging

2 hooks

Event Handling

17 hooks
useDocumentEventListenerstablerooks

Attaches a document event listener and removes it when the component unmounts.

useDocumentVisibilityStatestablerooks

Returns the document visibility state and updates when it changes.

useFocusstablerooks

Provides focus and blur props for an element's own focus boundary.

useFocusWithinstablerooks

Provides focus props that track entry to and exit from an element subtree.

useIsDroppingFilesstablerooks

Reports whether files are being dragged over an element or the window.

useOnClickRefstablerooks

Returns a ref that handles native click and touch-end events.

useOnHoverRefstablerooks

Returns a ref that handles native mouse-enter and mouse-leave events.

useOnLongHoverstablerooks

Calls a callback after an element remains hovered for a duration.

Also exported as useOnLongHoverRef

useOnLongPressstablerooks

Calls a callback after an element remains pressed for a duration.

Also exported as useOnLongPressRef

useOnStartTypingstablerooks

Calls a callback for allowed typing keys outside editable elements.

useOnWindowResizestablerooks

Calls a callback for passive window resize events.

useOnWindowScrollstablerooks

Calls a callback for passive window scroll events.

useOutsideClickstablerooks

Calls a handler for click or touch-start events outside an object ref.

useOutsideClickRefstablerooks

Returns a ref and calls a handler for click or touch-start events outside it.

usePageLeavestablerooks

Calls a callback for unload, page-hide, and hidden-document signals.

useTextSelectionstablerooks

Returns the current text selection for the document or a target element.

useWindowEventListenerstablerooks

Attaches a window event listener and removes it when the component unmounts.

Form & File Handling

3 hooks

Keyboard & Input

5 hooks

Lifecycle & Effects

11 hooks

Mouse & Touch

3 hooks

Performance & Optimization

5 hooks

State Management

19 hooks
useArrayStatestablerooks

Manages an array state with helper methods for push, pop, splice, sort, and more.

useCountdownstablerooks

Counts the intervals remaining until a target Date and reports progress or completion.

useCounterstablerooks

Manages a numeric counter with increment, decrement, and reset operations.

useGetIsMountedstablerooks

Returns a function that reports whether the component is currently mounted.

useLocalstorageStatestablerooks

Persists React state in localStorage and synchronizes matching hook instances.

useMapStatestablerooks

Manages a record-like object as React state with keyed update and removal helpers.

Also exported as useObjectState

useMultiSelectableListstablerooks

Manages multiple-selection list state with toggle and select-all helpers.

useNativeMapStatestablerooks

Manages a native Map object in React state with reactive update helpers.

usePreviousDifferentstablerooks

Returns the most recent previous value that was different from the current one.

usePreviousImmediatestablerooks

Returns the previous value of a variable immediately after it changes.

usePromisestablerooks

Tracks the status and result of a Promise (pending, resolved, or rejected).

useQueueStatestablerooks

Manages queue (FIFO) state with enqueue, dequeue, and peek operations.

useRafStatestablerooks

Updates React state on each requestAnimationFrame tick.

useSafeSetStatestablerooks

Calls setState only if the component is still mounted, preventing memory leaks.

useSelectstablerooks

Manages a selection state from a list of options with helpers.

useSelectableListstablerooks

Manages a single-selection list state with toggle and clear helpers.

useSessionstorageStatestablerooks

Persists React state in sessionStorage and synchronizes matching hook instances.

useSetStatestablerooks

Manages a Set data structure as React state with add, delete, and clear helpers.

useStackStatestablerooks

Manages stack (LIFO) state with push, pop, and peek operations.

State History & Time Travel

4 hooks

UI & Layout

14 hooks
useAudiostablerooks

Controls an audio element while exposing playback, loading, timing, volume, rate, loop, and error state.

useBoundingclientrectstablerooks

Reads an element's DOMRect after mount and whenever the observed DOM subtree mutates.

useBoundingclientrectRefstablerooks

Supplies a callback ref, its current DOMRect, and a manual measurement function.

useDimensionsRefstablerooks

Measures an attached div after layout and optionally on window resize and scroll.

useFullscreenstablerooks

Enters, exits, and tracks Fullscreen API state for the document or a target element.

useIntersectionObserverRefstablerooks

Returns a callback ref that forwards IntersectionObserver notifications to the latest callback.

useInViewRefstablerooks

Returns a callback ref and whether its element currently intersects an observer root.

useMeasurestablerooks

Measures client, offset, and scroll dimensions with ResizeObserver and optional debouncing.

useMediaMatchstablerooks

Subscribes to a CSS media query with a deterministic server-rendered fallback.

useMutationObserverstablerooks

Observes mutations on the element in an existing object ref and cleans up automatically.

useMutationObserverRefstablerooks

Returns a callback ref that observes DOM mutations on its current element.

usePictureInPictureApistablerooks

Detects, enters, exits, and tracks standard Picture-in-Picture state for a video element.

usePreferredColorSchemestablerooks

Tracks the user's light, dark, or no-preference color-scheme media setting.

useVideostablerooks

Supplies a video ref with playback, timing, mute, volume, seeking, and fullscreen controls.

Utilities & Refs

7 hooks

Window & Viewport

2 hooks

Experimental Hooks

25 hooks
useAsyncDisposableexperimentalrooks/experimental

Manages async disposable resources using the TC39 Explicit Resource Management proposal.

useBeforeUnloadexperimentalrooks/experimental

Prompt before the page unloads when a guard passes.

useBrowserCookieStateexperimentalrooks/experimental

Persist React state in browser cookies with same-document synchronization.

useDisposableexperimentalrooks/experimental

Manages synchronous disposable resources using the TC39 Explicit Resource Management proposal.

useEventListenerexperimentalrooks/experimental

Strongly typed event-listener primitive for browser EventTargets.

useIsClientexperimentalrooks/experimental

Tell whether the component has mounted on the client.

useKeyPressexperimentalrooks/experimental

Track whether one or more keyboard keys are currently pressed.

useLocationHashexperimentalrooks/experimental

Read the current location hash, including the leading #.

useLocationSearchParamexperimentalrooks/experimental

Read the first value for a specific search parameter.

useLocationSnapshotexperimentalrooks/experimental

Read the current browser location as a stable snapshot.

useMediaDevicesexperimentalrooks/experimental

Enumerate and refresh available media input and output devices.

usePermissionexperimentalrooks/experimental

Query and optionally watch browser permission state.

useRequestexperimentalrooks/experimental

Generic promise-request lifecycle hook with retries, polling, and mutation.

useResponsiveexperimentalrooks/experimental

Track a named set of media queries and compute the current breakpoint.

useScriptexperimentalrooks/experimental

Load and share external script state across multiple consumers.

useScrollexperimentalrooks/experimental

Track an element's scroll offsets and scrollable bounds.

useSizeexperimentalrooks/experimental

Measure an element with ResizeObserver using a callback ref.

useSuspenseFaviconexperimentalrooks/experimental

Loads a favicon and suspends the component until the resource is ready.

useSuspenseIndexedDBStateexperimentalrooks/experimental

Reads and writes IndexedDB state with Suspense support.

useSuspenseLocalStorageStateexperimentalrooks/experimental

Reads and writes localStorage state with Suspense support.

useSuspenseNavigatorBatteryexperimentalrooks/experimental

Reads battery status from the Battery API with Suspense support.

useSuspenseNavigatorUserAgentDataexperimentalrooks/experimental

Reads User-Agent Client Hints with Suspense support.

useSuspenseSessionStorageStateexperimentalrooks/experimental

Reads and writes sessionStorage state with Suspense support.

useVirtualListexperimentalrooks/experimental

Render a fixed-size virtual list with ready-to-use item styles.

useWebSocketexperimentalrooks/experimental

Manage a WebSocket connection with parsing, sending, and reconnection helpers.

Temporal Hooks

4 hooks

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

Supported aliases

AliasCanonical documentation
useObjectStateuseMapState
useOnLongHoverRefuseOnLongHover
useOnLongPressRefuseOnLongPress

The alias names refer to the same implementations; they do not have duplicate reference pages. Internal source helpers are excluded from this index.

On this page