Reactuse

SkillWeb & browsing

Practical playbook for React teams to choose and apply reactuse hooks across state, async flows, browser APIs, and UI interactions. Use it when replacing custom hook logic with production-ready patterns that stay compatible with SSR and Next.js.

Available today. Use it from your connected AI after setup.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Reactuse skill

What this skill tells your AI

The instructions your AI receives, as published by siberiacancode/agent-skills in skills/reactuse/SKILL.md and read by ahel’s review.

This skill is a decision-and-implementation guide for reactuse library for react.js / next.js projects. It maps requirements to the most suitable reactuse hook, applies the correct usage pattern, and prefers hook-based solutions over bespoke code to keep implementations concise, maintainable, and performant.

When to Apply

  • Apply this skill whenever assisting development work in React.js / Next.js.
  • Always check first whether a reactuse hook can implement the requirement.
  • Prefer reactuse hooks over custom code to improve readability, maintainability, and performance.
  • Map requirements to the most appropriate hook and follow the hook’s invocation rule.
  • Please refer to the Invocation field in the hooks table. For example:
    • AUTO: Use automatically when applicable.
    • EXTERNAL: Use only if the user already installed the required external dependency; otherwise reconsider, and ask to install only if truly needed.
    • EXPLICIT_ONLY: Use only when explicitly requested by the user.

      NOTE User instructions in the prompt or AGENTS.md may override a hook’s default Invocation rule.

Hooks

All hooks listed below are part of the reactuse library. Each section categorizes hooks based on their functionality.

IMPORTANT: Each hook entry includes a short Description and a detailed Reference. When using any hook, always consult the corresponding document in ./references for usage details and type declarations.

Blocked upstream category: Reactuse also exports Humor hooks (useFul, useLess, useOnce) in recent releases. This skill intentionally does not support or recommend them because upstream marks them as jokes or non-production utilities.

Helpers

HookDescriptionInvocation
cnNormalizes conditional class names for React className.HIGH
createContextCreates a typed context with provider and selector hook.HIGH
createContextHookScopes one hook result to a React subtree.LOW
createEventEmitterCreates a type-safe event emitter with a subscription hook.LOW
createReactiveContextCreates a typed context selector with optimized updates.LOW
createSharedHookShares one hook instance across consumers.LOW
createStoreCreates a external store with state, subscriptions, and a hook.MEDIUM
makeDestructurableSupports object and tuple consumption from one value.LOW
targetWraps DOM targets in the shape Reactuse hooks expect.MEDIUM

Elements

HookDescriptionInvocation
useActiveElementTracks the currently focused element.LOW
useAutoScrollAutomatically scrolls a container to the bottom.LOW
useClickOutsideCalls a callback when clicking outside the target element.HIGH
useContextMenuConverts secondary-click and long-press gestures to menu state.LOW
useDoubleClickDetects double-clicks with optional single-click handler.MEDIUM
useDraggableConverts pointer movement into drag position state.LOW
useDropZoneCreates a drag-and-drop area with file state.MEDIUM
useFileDialogOpens a file picker and returns selected files.LOW
useFocusTracks focus state and provides focus/blur controls.MEDIUM
useFocusTrapTraps focus within a given element.MEDIUM
useHoverTracks hover state for an element.MEDIUM
useImageLoads an image in the browser and returns image-specific loading state.LOW
useLockScrollLocks scrolling on an element or the document body.MEDIUM
useLongPressDetects long press interactions.MEDIUM
usePaintDraws on a canvas and exposes drawing controls.LOW
useScriptLoads a script and returns its status.LOW
useSizeObserves element width and height.LOW
useStickyDetects whether a sticky element is stuck.LOW
useTextareaAutosizeAuto-resizes a textarea based on content.MEDIUM
useTextDirectionGets and sets the text direction of an element.MEDIUM
useWindowFocusReturns the current focus state of the window.LOW
useWindowSizeReturns current window width and height.LOW

Async

HookDescriptionInvocation
useAsyncTracks loading, error, and data state for a promise-returning callback.MEDIUM
useLockCallbackPrevents a callback from running multiple times simultaneously.MEDIUM
useMutationDefines mutation logic with loading, error, and success state.HIGH
useOptimisticAllows showing an optimistic value before the async update resolves.MEDIUM
useQueryWraps abortable async reads in query state and refresh controls.HIGH

Lifecycle

HookDescriptionInvocation
useAsyncEffectRuns async side effects.MEDIUM
useDidUpdateRuns an effect only on updates (not on initial mount).HIGH
useIsFirstRenderReturns true only on the first render.LOW
useIsomorphicLayoutEffectUses useLayoutEffect on the client and useEffect on the server.HIGH
useMountRuns a callback once when the component mounts.HIGH
useShallowEffectRuns an effect only when dependencies change shallowly or deeply.LOW
useUnmountRuns a callback when the component unmounts.HIGH

Browser

HookDescriptionInvocation
useAudioManages audio playback (play/pause/stop), volume, rate, and sprite segments.LOW
useBatteryReturns battery status and support state.LOW
useBluetoothRequests and connects to Bluetooth devices.LOW
useBreakpointsManages responsive breakpoints and helper predicates.MEDIUM
useBroadcastChannelEnables cross-tab/window messaging.LOW
useBrowserLocationReturns reactive location state and history navigation controls.MEDIUM
useClipboardReads and copies text from the clipboard.MEDIUM
useCopyCopies text and resets status after a delay.MEDIUM
useCssVarReads and writes a CSS custom property.LOW
useDeviceListGroups available media input and output devices for pickers.MEDIUM
useDisplayMediaConnects a video element to a screen-capture stream.LOW
useDocumentEventAttaches an event listener to the document.LOW
useDocumentTitleReads and updates the document title.LOW
useDocumentVisibilityReturns the document visibility state.LOW
useEventListenerAttaches an event listener to a target.HIGH
useEventSourceProvides a reactive wrapper around EventSource.LOW
useEyeDropperProvides access to the EyeDropper API.LOW
useFaviconReads and updates the current favicon.LOW
useFileSystemAccessReads and writes local files via the File System Access API.LOW
useFpsMeasures frames per second.LOW
useFullscreenControls fullscreen state for an element.LOW
useGamepadReturns connected gamepads and active status.LOW
useGeolocationKeeps the latest browser geolocation reading in React state.MEDIUM
useMeasureMeasures an element's size and position.LOW
useMediaControlsProvides controls and state for audio/video elements.LOW
useMediaStreamConnects camera or microphone capture to a media element.MEDIUM
useMediaQueryReturns whether a media query matches.MEDIUM
useMemoryReturns the current JS heap memory usage.LOW
useNetworkTracks online status and connection information.LOW
useNotificationManages notification permission and the latest notification.MEDIUM
useOnlineReturns whether the user is online.MEDIUM
useObjectUrlCreates and revokes an object URLLOW
useOtpCredentialRequests an OTP credential from the user agent.LOW
usePermissionTracks browser permission query state.MEDIUM
usePictureInPictureControls Picture-in-Picture mode for video elements.LOW
usePointerLockProvides reactive pointer lock controls.LOW
usePostMessageReceives and posts messages between windows/frames.LOW
useRafRuns a callback on each animation frame.LOW
useShareTriggers the native share dialog.MEDIUM
useSpeechRecognitionTurns browser speech recognition into transcript state.LOW
useSpeechSynthesisTurns text into spoken output with playback state.LOW
useVibrateTriggers vibration with optional intervals.LOW
useVirtualKeyboardTracks virtual keyboard state and exposes controls.LOW
useWakeLockControls the Wake Lock API state.LOW
useWebSocketKeeps a component connected to a WebSocket endpoint.MEDIUM
useWebWorkerConnects a Web Worker to React data and lifecycle state.LOW
useWebWorkerCallbackRuns a self-contained function off the main thread.LOW

Utilities

HookDescriptionInvocation
useBatchedCallbackBatches calls and forwards them to a callback.MEDIUM
useConstReturns a constant value initialized once.HIGH
useDebounceCallbackCreates a debounced callback with a cancel method.HIGH
useDebounceEffectRuns an effect after a delay when dependencies change.HIGH
useDebounceStateCreates a debounced state setter.HIGH
useDebounceValueReturns a debounced version of a value.HIGH
useDevicePixelRatioReturns the current device pixel ratio.LOW
useEventReturns a stable callback reference that always calls the latest handler.HIGH
useLastChangedRecords the timestamp of the last change.LOW
useLatestReturns a stable ref that always points to the latest value.MEDIUM
usePreviousReturns the previous value.LOW
useThrottleCallbackCreates a throttled callback with a cancel method.MEDIUM
useThrottleEffectRuns an effect at most once per delay period when dependencies change.MEDIUM
useThrottleStateCreates a throttled state setter.MEDIUM
useThrottleValueReturns a throttled version of a value.MEDIUM

State

HookDescriptionInvocation
useBooleanManages a boolean state with a toggle helper.HIGH
useControllableStateSupports controlled and uncontrolled state patterns.MEDIUM
useCookieReads and writes a cookie value.MEDIUM
useCookiesManages all cookies as a single object.MEDIUM
useCounterManages a numeric counter with bounds.LOW
useCycleListModels ordered choices as a current value plus navigation helpers.MEDIUM
useDefaultReturns a value or a provided default when nullish.MEDIUM
useDisclosureManages open/close state with helpers.HIGH
useFieldConnects one uncontrolled field to validation and helper state.MEDIUM
useFormCoordinates typed uncontrolled form values and validation.MEDIUM
useHashManages URL hash value.LOW
useListManages an array with helper methods.MEDIUM
useLocalStorageManages a value in localStorage.HIGH
useMapManages a Map with helper methods.HIGH
useMaskKeeps masked, raw, display, and cursor state aligned.MEDIUM
useMergedRefMerges multiple refs into a single ref callback.MEDIUM
useObjectManages object state with helper methods for updates and key operations.MEDIUM
useOffsetPaginationManages pagination state for offset-based lists.MEDIUM
useQueueManages a queue with add/remove helpers.MEDIUM
useRafStateUpdates state inside requestAnimationFrame.LOW
useRefStateCreates a ref-like state that updates on assignment.LOW
useSessionStorageManages a value in sessionStorage.MEDIUM
useSetManages a Set with helper methods.MEDIUM
useStateHistoryKeeps state with undo/redo history.MEDIUM
useStepCreates a stepper with next/back helpers.MEDIUM
useStorageManages a value in Web Storage.HIGH
useToggleA boolean switcher with utility functions.HIGH
useUrlSearchParamSyncs a single URL search param with state.HIGH
useUrlSearchParamsSyncs multiple URL search params with state.HIGH
useValidatedStateKeeps a value together with validity and last valid value.MEDIUM
useWizardManages wizard steps and history.MEDIUM

User

HookDescriptionInvocation
useBrowserLanguageReturns the current browser language.MEDIUM
useOperatingSystemReturns the user's operating system based on the user agent.LOW
usePreferredColorSchemeReturns the user's preferred color scheme.MEDIUM
usePreferredContrastReturns the user's contrast preference.MEDIUM
usePreferredDarkReturns whether the user prefers dark mode.MEDIUM
usePreferredLanguagesReturns the user's preferred languages.MEDIUM
usePreferredReducedMotionReturns the reduced motion preference.LOW

Sensors

HookDescriptionInvocation
useDeviceMotionProvides device motion data via snapshot and watch().LOW
useDeviceOrientationProvides the current device orientation.LOW
useHotkeysScopes keyboard shortcuts to a target or returned ref.MEDIUM
useIdleTracks whether the user is idle and last active time.LOW
useInfiniteScrollTriggers guarded loading near a scroll edge.MEDIUM
useIntersectionObserverTracks intersection state for an element.MEDIUM
useKeyboardRegisters keydown/keyup listeners on a target.MEDIUM
useKeyPressTracks whether specific keys are pressed.MEDIUM
useKeysPressedTracks all currently pressed keys.LOW
useMouseTracks mouse coordinates relative to page and element.LOW
useMutationObserverObserves DOM mutations on an element.LOW
useOrientationReturns the current screen orientation and lock controls.LOW
usePageLeaveDetects when the mouse leaves the page.LOW
useParallaxCreates a parallax effect based on mouse or device orientation.LOW
usePerformanceObserverObserves performance entries.LOW
useResizeObserverObserves size changes for an element.LOW
useScrollTracks scroll state and provides scroll helpers.LOW
useScrollIntoViewScrolls an element into view and exposes a trigger.LOW
useScrollToScrolls to a specific position with a trigger.LOW
useSwipeConverts touch and pointer movement into swipe state.LOW
useTextSelectionTracks text selection details.LOW
useVisibilityTracks whether an element is visible in the viewport.MEDIUM
useWindowEventAttaches an event listener to the window object.LOW
useWindowScrollTracks window scroll position and exposes scrollTo.LOW

Time

HookDescriptionInvocation
useIntervalCreates an interval with controls to pause and resume it.HIGH
useProgressCreates progress state with auto-incrementing controls.MEDIUM
useStopwatchCreates a stopwatch with start, pause, and reset controls.HIGH
useTimeProvides the current time split into multiple fields.MEDIUM
useTimeoutRuns a callback after a delay and returns a ready flag.MEDIUM
useTimerCreates a countdown timer with controls and callbacks.MEDIUM

Debug

HookDescriptionInvocation
useLoggerLogs mount, update, and unmount for a component.LOW
useRenderCountReturns how many times a component has rendered.LOW
useRenderInfoProvides render count and timing info, with optional logging.LOW
useRerenderForces a component rerender on demand.MEDIUM

Signals

GitHub stars
23
Forks
1
Last commit
Sep 2026

ahel review

  • K1binfo
    installs-packages (in README.md)

Automated review, not a security audit. Ruleset v1+k2.

Advanced
Item type
skill
Key
reactuse
Source
github.com/siberiacancode/agent-skills