useEffectAfterMount
Runs an effect only when its dependencies change after mount, skipping the first render.
useApi
Sends an HTTP request and tracks its loading, data and error state, with a refetch function to run the request again.
useOutsideClick
Calls a callback when a click or touch happens outside an element, for closing dropdowns, modals and popovers.
useToggleState
Manages a boolean with a single toggle function, for showing and hiding UI or switching between two states.
useControlledState
Lets a component work both controlled and uncontrolled, like a native input, by using the value prop when given and internal state otherwise.
usePersistedState
Works like useState but saves the value to localStorage and keeps it in sync across tabs.
useDocVisible
Tracks whether the browser tab is visible, so you can pause playback, polling or animations while the user is elsewhere.
useMounted
Tracks whether a component is mounted and runs optional onMount and onUnmount callbacks.
useSequentialRequest
Wraps an async request so only the latest call counts, aborting the previous in-flight request.
useAutofillSubmit
Submits a form as soon as a password manager or browser autofill fills it, so picking a saved login is enough to sign in.
useLatest
Returns a stable ref that always holds the latest value, so timers, listeners and async code avoid stale closures.
usePrevious
Returns the value from the previous render without causing extra re-renders.
useEventListener
Attaches a typed event listener to the window, document, an element, a ref or any EventTarget and removes it on cleanup.
useThrottledValue
Returns a copy of a value that updates at most once per interval while it keeps changing, such as a scroll or pointer position.
useInterval
A declarative setInterval that calls the latest callback every delay milliseconds and pauses when the delay is null.
useMediaQuery
Returns whether a CSS media query matches, for breakpoints, dark mode and reduced motion, and is safe to hydrate.
useClipboard
Copies text to the clipboard and returns a temporary copied flag for feedback, capturing failures as state instead of throwing.
useCooldown
Counts down whole seconds after an action so it can't be repeated straight away, with controls to start, restart or cancel.
useDebouncedCallback
Returns a stable debounced function with cancel, flush and isPending controls and optional leading or trailing calls.
useIsomorphicLayoutEffect
A useLayoutEffect that is safe in server-rendered apps, falling back to useEffect where there is no DOM.
useStableCallback
Returns a function with a stable identity that always calls your latest callback, for memoized children and subscriptions.
useTimeout
A declarative setTimeout that calls the latest callback once after a delay, with start, cancel and isPending controls.
useElementSize
Tracks an element's width and height as state with a ResizeObserver, re-rendering only when the size changes.
useResizeObserver
Runs a callback with the raw ResizeObserverEntry whenever an element resizes, without re-rendering your component.
useIntersectionObserver
Tracks whether an element is visible in the viewport or a scroll container, for lazy loading, reveal animations and infinite scroll.
useAsync
Runs any async function on demand or on mount and tracks its status, data and error, ignoring results from older runs.
useDebouncedValue
Returns a copy of a value that only updates once it stops changing for a delay, such as a search term after the user stops typing.
useWebLock
Runs async work under a named Web Lock so only one tab, window or worker runs it at a time, or many in shared mode.
useTabLeader
Elects one browser tab as the leader among all same-origin tabs, so polling, websockets or syncs run once instead of in every open tab.
useRateLimitedCallback
Returns a stable function that runs a callback at most a set number of times per window, dropping or queueing extra calls.
useNow
Returns the current time and re-renders at an interval, sharing one timer per interval, for relative timestamps and countdowns.
useImpression
Calls a callback once an element has been visible enough for long enough, for analytics, ad views and marking items as read.
useIsStuck
Tells whether a position: sticky element is currently stuck, so a sticky header can gain a shadow only while pinned.
useFrecency
Ranks items by how often and how recently they were used, remembered across reloads, for command palettes and recent items.
useDebounce (deprecated)
Deprecated alias of useDebouncedCallback that will be removed in a future release; use useDebouncedCallback or useDebouncedValue instead.
useThrottle (deprecated)
Deprecated alias of useThrottledValue that will be removed in a future release; use useThrottledValue instead.