Skip to main content

Hooks

Generated from exported hooks in @ts-hooks-kit/core with summaries from source JSDoc.


  • useAsync

    Custom hook that manages the state of an async function.

  • useBoolean

    Custom hook that handles boolean state with useful utility functions.

  • useClickAnyWhere

    Custom hook that handles click events anywhere on the document.

  • useCopyToClipboard

    Custom hook that copies text to the clipboard using the [`Clipboard API`](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API).

  • useCountdown

    Custom hook that manages countdown.

  • useCounter

    Custom hook that manages a counter with increment, decrement, reset, and setCount functionalities.

  • useDarkMode

    Custom hook that returns the current state of the dark mode.

  • useDebounceCallback

    Custom hook that creates a debounced version of a callback function.

  • useDebounceValue

    Custom hook that returns a debounced version of the provided value, along with a function to update it.

  • useDisclosure

    Custom hook for managing boolean disclosure state (modals, popovers, drawers, etc.).

  • useDocumentTitle

    Custom hook that sets the document title.

  • useEventCallback

    Custom hook that creates a memoized event callback.

  • useEventListener

    useEventListener hook for React apps.

  • useGeolocation

    Custom hook that provides access to the browser's geolocation API.

  • useHover

    Custom hook that tracks whether a DOM element is being hovered over.

  • useIdle

    Custom hook that tracks whether the user is idle (no activity for a specified time).

  • useIntersectionObserver

    Custom hook that tracks the intersection of a DOM element with its containing element or the viewport using the [`Intersection Observer API`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).

  • useInterval

    Custom hook that creates an interval that invokes a callback function at a specified delay using the [`setInterval API`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval).

  • useIsClient

    Custom hook that determines if the code is running on the client side (in the browser).

  • useIsMounted

    Custom hook that determines if the component is currently mounted.

  • useIsomorphicLayoutEffect

    Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).

  • useList

    Custom hook that manages a list state with setter actions.

  • useLocalStorage

    Custom hook that uses the [`localStorage API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to persist state across page reloads.

  • useMap

    Custom hook that manages a key-value [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) state with setter actions.

  • useMediaQuery

    Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).

  • useMemoizedFn

    Custom hook that returns a memoized version of a function that never changes reference. The returned function will always call the latest version of the callback, but its identity (reference) will remain stable across renders. This is useful when you need to pass a callback to a dependency array or child component without causing unnecessary re-renders.

  • useNetwork

    Custom hook that tracks the browser's network connection status.

  • useOnClickOutside

    Custom hook that handles clicks outside a specified element.

  • usePageLeave

    Custom hook that invokes a callback when the user's mouse leaves the page.

  • usePagination

    Custom hook for managing pagination logic. Returns page navigation functions and a range array suitable for pagination UI.

  • usePermission

    Custom hook that tracks the state of a browser permission.

  • usePrevious

    Returns the previous value of a variable from the last render. On the first render, returns `undefined` or the provided initial value.

  • useQueue

    Custom hook that manages a FIFO (First In, First Out) queue state with setter actions.

  • useReadLocalStorage

    useReadLocalStorage hook for React apps.

  • useResizeObserver

    Custom hook that observes the size of an element using the [`ResizeObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).

  • useScreen

    useScreen hook for React apps.

  • useScript

    Custom hook that dynamically loads scripts and tracking their loading status.

  • useScrollLock

    A custom hook that locks and unlocks scroll.

  • useSessionStorage

    Custom hook that uses the [`sessionStorage API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) to persist state across page reloads.

  • useSet

    Custom hook that manages a [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) state with setter actions.

  • useStateList

    Custom hook for navigating through a list of states. Useful for step-by-step flows, carousels, or multi-step forms.

  • useStep

    Custom hook that manages and navigates between steps in a multi-step process.

  • useTernaryDarkMode

    Custom hook that manages ternary (system, dark, light) dark mode with local storage support.

  • useThrottle

    Custom hook that throttles a value, ensuring updates occur at most once per wait period.

  • useTimeout

    Custom hook that handles timeouts in React components using the [`setTimeout API`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout).

  • useToggle

    Custom hook that manages a boolean toggle state in React components.

  • useUnmount

    Custom hook that runs a cleanup function when the component is unmounted.

  • useFirstMountState

    Custom hook that returns true on the first render, false thereafter.

  • useMethods

    Custom hook that manages state with method-based updates.

  • useMediatedState

    Custom hook that manages state with a mediator function that transforms values.

  • useMultiStateValidator

    Custom hook that validates multiple states at once.

  • useRendersCount

    Custom hook that returns the number of times a component has rendered.

  • useStateWithHistory

    Custom hook that stores previous state values and provides navigation.

  • useUpdate

    Custom hook that returns a function to force a component re-render.

  • useUpdateEffect

    A hook that runs an effect only when dependencies change, skipping the initial mount. This is useful for responding to prop or state changes without running on first render.

  • useWindowSize

    useWindowSize hook for React apps.