Skip to content

Functions

Explore hooks by category from the left sidebar and jump into implementation details quickly.

Core
Sort by

Animation

useAnimate-Run element animations with controls
useIntervalFn-Controlled interval with start/stop
usePresenceTransition-Presence transition stage helper
useRafFn-requestAnimationFrame loop controls
useRafState-Schedule state updates with requestAnimationFrame
useTimeoutFn-Controlled timeout with start/stop

Array

useArrayDifference-Memoized array difference
useArrayEvery-Memoized array every
useArrayFilter-Memoized array filter
useArrayFind-Memoized array find
useArrayFindIndex-Memoized array findIndex
useArrayFindLast-Memoized last matching array element
useArrayIncludes-Memoized array includes
useArrayJoin-Memoized array join
useArrayMap-Memoized array map
useArrayReduce-Memoized array reduce
useArraySome-Memoized array some
useArrayUnique-Memoized unique array (Set)
useCycleList-Cycle through a list with state
useSorted-Return a sorted copy of an array
useStepper-Clamped step index between min and max

Browser

useBluetooth-Request Bluetooth devices
useBreakpoints-Resolve responsive breakpoints from window width
useBroadcastChannel-BroadcastChannel wrapper hook
useBrowserLocation-Track browser URL location fields
useClipboardItems-Read ClipboardItem entries
useColorMode-Manage color mode (light/dark/auto)
useCopyToClipboard-Copy text to the clipboard
useCssSupports-Check CSS feature support
useCssVar-Read and update CSS variables
useDark-Manage dark mode state and DOM classes
useEyeDropper-Sample colors with the EyeDropper API
useFavicon-Update the page favicon dynamically
useFileDialog-Open and read file chooser
useFileSystemAccess-Read and save files
useFullscreen-Fullscreen control hook
useGamepad-Track connected gamepads
useHash-Read and update URL hash state
useImage-Reactive image loader
useLockBodyScroll-Lock body scrolling while active
useMediaControls-Control media playback
useMediaQuery-React to media query matches
useMemory-Read JS heap memory
useObjectUrl-Blob to object URL with cleanup
usePageVisibility-Track page visibility changes
usePerformanceObserver-Observe performance entries
usePermission-Track browser permission state
usePreferredColorScheme-Track preferred color scheme
usePreferredContrast-Track preferred contrast level
usePreferredDark-Track preferred dark mode
usePreferredLanguages-Track preferred browser languages
usePreferredReducedMotion-Track reduced-motion preference
usePreferredReducedTransparency-Track reduced transparency preference
useScreenOrientation-Track screen orientation state
useScreenSafeArea-Read safe-area insets
useScript-Load external scripts with status
useShare-Share content with Web Share API
useSSRWidth-Read viewport width with SSR fallback
useStyleTag-Inject dynamic CSS style tag
useTextDirection-Track document text direction
useTitle-Set and restore document title
useUrlSearchParams-Manage URL search query params
useVibrate-Trigger device vibration patterns
useWakeLock-Manage screen wake lock state
useWebNotification-Browser notification helper
useWebWorker-Web Worker state hook
useWebWorkerFn-Run function in Web Worker
useWindowSize-Track window width and height

Component

useMountedState-Check if component is mounted
useOnMount-Run logic when component mounts
useVirtualList-Virtualize fixed-height lists

Elements

useActiveElement-Track active focused element
useClickOutside-Handle clicks outside an element
useDraggable-Make an element draggable
useDropZone-Track drag-and-drop zone state
useElementBounding-Track element bounding rect
useElementSize-Track element width and height
useElementVisibility-Track element viewport visibility
useParentElement-Get parent element from ref
useTextareaAutoSize-Auto-resize textarea to fit content
useWindowFocus-Track window focus state
useWindowScroll-Track window scroll offsets

Network

useAbortController-Cancel stale async requests
useAsync-Manage async state and execution
useEventSource-Subscribe to server-sent events
useFetch-Fetch JSON with state and abort
useWebSocket-WebSocket connection and message state

Reactivity

useEventCallback-Keep callback identity stable
useRefAutoReset-Auto-reset reactive value
useRefDebounced-Debounced reactive value
useRefThrottled-Throttled reactive value

Sensors

onElementRemoval-Callback when a node is disconnected
onKeyStroke-Subscribe to key events with a filter
onLongPress-Pointer long-press handlers
onStartTyping-After idle, detect next printable keystroke
useBattery-Battery status from getBattery
useDeviceMotion-Track device motion
useDeviceOrientation-Track device orientation
useDevicePixelRatio-Track device pixel ratio
useDevicesList-List media devices
useDisplayMedia-Capture display media stream
useElementByPoint-Resolve element by viewport point
useElementHover-Track hover state for an element
useFocus-Track focus state for one element
useFocusWithin-Track focus within a container
useFps-Estimate current frames per second
useGeolocation-Track browser geolocation
useIdle-Detect user inactivity
useInfiniteScroll-Trigger callback near scroll end
useIntersectionObserver-Track element visibility in viewport
useKeyModifier-Track pressed modifier keys
useMagicKeys-Track pressed keyboard keys
useMouse-Track viewport mouse coordinates
useMousePressed-Track mouse pressed state
useMutationObserver-Observe DOM mutations
useNavigatorLanguage-Track active browser language
useNetwork-Track network connection metadata
useOnline-Track browser online status
usePageLeave-Trigger callback when cursor leaves page
useParallax-Compute parallax transform from pointer
usePointer-Track pointer coordinates and pressed state
useResizeObserver-Track element size changes
useScroll-Track window scroll offsets
useSpeechRecognition-Speech-to-text recognition state
useSpeechSynthesis-Text-to-speech playback controls
useSwipe-Detect touch swipe direction
useTextSelection-Track current text selection
useUserMedia-Manage getUserMedia stream lifecycle

State

useAsyncState-Async state loader
useCounter-Numeric counter with helpers
useDebounce-Delay value updates until input settles
useDebouncedRefHistory-Debounced state history snapshots
useLastChanged-Track timestamp of last value change
useLatest-Store the latest value in a ref
useManualRefHistory-Manual commit history snapshots
usePrevious-Read the previous value
useRefHistory-State with history snapshots
useStorage-Storage-backed state
useStorageAsync-Async storage-backed state
useThrottle-Limit update frequency
useThrottledRefHistory-Throttled state history snapshots
useToggle-Toggle boolean state

Time

useCountdown-Countdown to a future instant
useDateFormat-Format dates with Intl
useInterval-Declarative setInterval
useNow-Live current Date
useTimeAgo-Human-readable relative time
useTimeAgoIntl-Intl relative time (alias)
useTimeout-Declarative setTimeout
useTimestamp-Live millisecond timestamp

Utilities

createEventHook-Factory for a tiny event bus
createGlobalState-Shared global useSyncExternalStore state
createInjectionState-Create Provider + injector pair
createSharedComposable-Singleton result for a composable
createUnrefFn-Normalize value-or-getter to getter
get-Read deep property by path
isDefined-Type guard for defined values
makeDestructurable-Add tuple destructuring to object
set-Set deep property by path
useAsyncQueue-Run async tasks sequentially
useBase64-Encode value as Base64
useCached-Memoized computed value by deps
useCloned-Return a deep-cloned value
useConfirmDialog-Promise-based confirm dialog state
useDebounceFn-Debounce function execution
useEventBus-Lightweight in-memory event bus
useLocalStorage-Persist state in localStorage
useMemoize-Memoize function results by arguments
useOffsetPagination-Page, size, and offset for lists
useSessionStorage-Persist state in sessionStorage
useSupported-Runtime feature support check
useThrottleFn-Throttle function execution
useTimeoutPoll-Polling with setTimeout loop
useToNumber-Convert any value to number
useToString-Convert any value to string

Watch

useEventListener-Attach and clean up event listeners
useWatchArray-Watch array membership changes
useWatchAtMost-Watch a value with a run limit
useWatchDebounced-Debounce watched values
useWatchDeep-Watch deep object changes
useWatchIgnorable-Watcher with temporary ignore
useWatchImmediate-Watch value changes immediately
useWatchOnce-Watch a value only once
useWatchPausable-Pausable value watcher
useWatchThrottled-Throttle watched values
useWatchTriggerable-Watcher with manual trigger
useWatchWithFilter-Watcher with predicate filter
useWhenever-React to truthy transitions

Released under the MIT License.