Skip to content
react-use logo

React Use

react-use

Collection of essential React Hooks for sensors, UI, animations, side-effects, lifecycles, and state management

SKILL.md

Full skill instructions

react-use

The skill is based on react-use v17.6.0, generated at 2026-01-29.

react-use is a collection of essential React Hooks that provide ready-to-use functionality for common patterns in React applications. It includes hooks for sensors, UI interactions, animations, side-effects, lifecycle management, and state management.

Core References

TopicDescriptionReference
UsageImport patterns and tree-shaking recommendationscore-usage

Sensors

Sensor hooks listen to changes in browser APIs and device interfaces, forcing components to re-render with updated state.

TopicDescriptionReference
useBatteryTracks device battery statussensors-battery
useGeolocationTracks geo location state of user's devicesensors-geolocation
useHoverTracks mouse hover state of an elementsensors-hover
useHashTracks location hash valuesensors-hash
useIdleTracks whether user is being inactivesensors-idle
useIntersectionTracks an HTML element's intersectionsensors-intersection
useKeyTracks key pressessensors-key
useKeyPressTracks key press statesensors-key-press
useKeyPressEventHandles key press eventssensors-key-press-event
useKeyboardJsTracks keyboard key combinationssensors-keyboard-js
useLocationTracks page navigation bar location statesensors-location
useSearchParamTracks URL search parameterssensors-search-param
useLongPressTracks long press gesturesensors-long-press
useMediaTracks state of a CSS media querysensors-media
useMediaDevicesTracks state of connected hardware devicessensors-media-devices
useMotionTracks state of device's motion sensorsensors-motion
useMouseTracks state of mouse positionsensors-mouse
useMouseWheelTracks deltaY of scrolled mouse wheelsensors-mouse-wheel
useNetworkStateTracks browser's network connection statesensors-network-state
useOrientationTracks device's screen orientationsensors-orientation
usePageLeaveTriggers when mouse leaves page boundariessensors-page-leave
useScratchTracks mouse click-and-scrub statesensors-scratch
useScrollTracks an HTML element's scroll positionsensors-scroll
useScrollingTracks whether HTML element is scrollingsensors-scrolling
useStartTypingDetects when user starts typingsensors-start-typing
useWindowScrollTracks Window scroll positionsensors-window-scroll
useWindowSizeTracks Window dimensionssensors-window-size
useMeasureTracks an HTML element's dimensionssensors-measure
useSizeTracks element sizesensors-size
createBreakpointTracks innerWidth with breakpointssensors-breakpoint
useScrollbarWidthDetects browser's native scrollbars widthsensors-scrollbar-width
usePinchZoomTracks pointer events to detect pinch zoomsensors-pinch-zoom

UI

UI hooks allow you to control and subscribe to state changes of UI elements.

TopicDescriptionReference
useAudioPlays audio and exposes its controlsui-audio
useClickAwayTriggers callback when user clicks outside target areaui-click-away
useCssDynamically adjusts CSSui-css
useDropTracks file, link and copy-paste dropsui-drop
useFullscreenDisplay an element or video full-screenui-fullscreen
useSliderProvides slide behavior over any HTML elementui-slider
useSpeechSynthesizes speech from a text stringui-speech
useVibrateProvides physical feedback using Vibration APIui-vibrate
useVideoPlays video, tracks its state, and exposes playback controlsui-video

Animations

Animation hooks usually interpolate numeric values over time.

TopicDescriptionReference
useRafRe-renders component on each requestAnimationFrameanimations-raf
useIntervalRe-renders component on a set intervalanimations-interval
useHarmonicIntervalFnHarmonic interval functionanimations-harmonic-interval
useSpringInterpolates number over time according to spring dynamicsanimations-spring
useTimeoutRe-renders component after a timeoutanimations-timeout
useTimeoutFnCalls given function after a timeoutanimations-timeout-fn
useTweenRe-renders component while tweening a number from 0 to 1animations-tween
useUpdateReturns a callback which re-renders component when calledanimations-update

Side-effects

Side-effect hooks allow your app to trigger various side-effects using browser's API.

TopicDescriptionReference
useAsyncResolves an async functionside-effects-async
useAsyncFnAsync function with manual executionside-effects-async-fn
useAsyncRetryAsync function with retry capabilityside-effects-async-retry
useBeforeUnloadShows browser alert when user tries to reload or close the pageside-effects-before-unload
useCookieProvides way to read, update and delete a cookieside-effects-cookie
useCopyToClipboardCopies text to clipboardside-effects-copy-to-clipboard
useDebounceDebounces a functionside-effects-debounce
useErrorError dispatcherside-effects-error
useFaviconSets favicon of the pageside-effects-favicon
useLocalStorageManages a value in localStorageside-effects-local-storage
useSessionStorageManages a value in sessionStorageside-effects-session-storage
useLockBodyScrollLocks scrolling of the body elementside-effects-lock-body-scroll
useRafLoopCalls given function inside the RAF loopside-effects-raf-loop
useThrottleThrottles a functionside-effects-throttle
useThrottleFnThrottle function variantside-effects-throttle-fn
useTitleSets title of the pageside-effects-title
usePermissionQuery permission status for browser APIsside-effects-permission

Lifecycles

Lifecycle hooks modify and extend built-in React hooks or imitate React Class component lifecycle patterns.

TopicDescriptionReference
useEffectOnceModified useEffect that only runs oncelifecycles-effect-once
useEventSubscribe to eventslifecycles-event
useLifecyclesCalls mount and unmount callbackslifecycles-lifecycles
useMountedStateTracks if component is mountedlifecycles-mounted-state
useUnmountPromiseTrack if component is mounted with promise supportlifecycles-unmount-promise
usePromiseResolves promise only while component is mountedlifecycles-promise
useLoggerLogs in console as component goes through life-cycleslifecycles-logger
useMountCalls mount callbackslifecycles-mount
useUnmountCalls unmount callbackslifecycles-unmount
useUpdateEffectRun an effect only on updateslifecycles-update-effect
useIsomorphicLayoutEffectuseLayoutEffect that works on serverlifecycles-isomorphic-layout-effect
useDeepCompareEffectuseEffect with deep comparisonlifecycles-deep-compare-effect
useShallowCompareEffectuseEffect with shallow comparisonlifecycles-shallow-compare-effect
useCustomCompareEffectuseEffect with custom comparison functionlifecycles-custom-compare-effect

State

State hooks allow you to easily manage state of booleans, arrays, and maps.

TopicDescriptionReference
createMemoFactory of memoized hooksstate-create-memo
createReducerFactory of reducer hooks with custom middlewarestate-create-reducer
createReducerContextFactory of hooks for sharing state between componentsstate-create-reducer-context
createStateContextFactory of hooks for sharing state between componentsstate-create-state-context
createGlobalStateCross component shared statestate-create-global-state
useDefaultReturns the default value when state is null or undefinedstate-default
useGetSetReturns state getter get() instead of raw statestate-get-set
useGetSetStateCombination of useGetSet and useSetStatestate-get-set-state
useLatestReturns the latest state or propsstate-latest
usePreviousReturns the previous state or propsstate-previous
usePreviousDistinctLike usePrevious but with a predicatestate-previous-distinct
useObservableTracks latest value of an Observablestate-observable
useRafStateCreates setState method which only updates after requestAnimationFramestate-raf-state
useSetStateCreates setState method which works like this.setStatestate-set-state
useToggleTracks state of a booleanstate-toggle
useCounterTracks state of a numberstate-counter
useListTracks state of an arraystate-list
useMapTracks state of an objectstate-map
useSetTracks state of a Setstate-set
useQueueImplements simple queuestate-queue
useStateListCircularly iterates over an arraystate-state-list
useStateValidatorValidates state with a validator functionstate-state-validator
useStateWithHistoryStores previous state values and provides handles to travel through themstate-state-with-history
useMultiStateValidatorAlike useStateValidator but tracks multiple statesstate-multi-state-validator
useMediatedStateLike regular useState but with mediation by custom functionstate-mediated-state
useFirstMountStateCheck if current render is firststate-first-mount-state
useRendersCountCount component rendersstate-renders-count
useMethodsNeat alternative to useReducerstate-methods

Miscellaneous

TopicDescriptionReference
useEnsuredForwardedRefUse a React.forwardedRef safelymisc-ensured-forwarded-ref

More Frontend Development skills

ui-ux-pro-max logo
Frontend Development

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
imagegen-frontend-web logo
Frontend Development

imagegen-frontend-web

Premium frontend image direction for landing pages and marketing sites, generating one distinct horizontal image per section.

92.7K 337.8K
View
imagegen-frontend-mobile logo
Frontend Development

imagegen-frontend-mobile

Premium mobile app screen concepts and flows with clean hierarchy, strong imagery, and distinctive art direction.

92.7K 331.8K
View
shadcn logo
Frontend Development

shadcn

Complete shadcn/ui component management for adding, searching, fixing, styling, and composing UI.

125.1K 271.7K
View
vercel-react-native-skills logo
Frontend Development

vercel-react-native-skills

React Native and Expo best practices for performant mobile apps across list rendering, animations, navigation, and native modules.

31.9K 231.8K
View
vercel-react-view-transitions logo
Frontend Development

vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

31.9K 143K
View
vercel-react-view-transitions logo
Frontend Development

vercel-react-view-transitions

Native browser animations for React UI state changes using the View Transition API.

31.9K 143K
View
convex-create-component logo
Frontend Development

convex-create-component

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View
web-artifacts-builder logo
Frontend Development

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

179.7K 106.4K
View
shadcn logo
Frontend Development

shadcn

Official shadcn/ui skill — teaches agents the CLI v4, the registry system, component patterns, and Tailwind v4 config.

125.1K 89.5K
View
tailwind-design-system logo
Frontend Development

tailwind-design-system

CSS-first design system framework for Tailwind v4 with tokens, components, and responsive patterns.

40.2K 67.4K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View