The useClickOutside() hook lets you trigger a callback whenever the user clicks outside of a target element
The useClipboard() hook will help you interact with the browser's navigator.clipboard property in order to copy text to the user's clipboard.
The useConfirmExit() hook lets you display a prompt to the user before he closes the current tab depending on whether the tab is declared to be dirty or not.
The useDebounce() hook lets you debounce value changes inside your components. Use this when you want to perform a heavy operation based on state
The useEventListener() hook lets you quickly add an event to a certain ref or the app's window if no ref is specified
The useFavicon() hook lets change the website's favicon dynamically from your components! The favicon changes back to the default one on refresh!
The useFirstRender() hook lets you detect whether or not the component you use it on is on its initial render, it returns a boolean value with the result.
The useHold() hook lets you detect long presses (holds) on target elements and trigger a handler after a set timeout is elapsed while the user is still holding down (click/touch) the element.
The useHover() hook lets you detect if the user's mouse is hovering over an element
The useIdle() hook lets you detect current user activity or inactivity on a web page, returning a boolean value that represents whether or not the user is currently active. The user is set as inactive when no events are triggered after a specified delay.
The useInputValue() hook lets you easily manage states for inputs in your components
The useIsomorphicLayoutEffect() hook lets switch between using useEffect and useLayoutEffect depending on the execution environment. If your app uses server side rendering, the hook will run useEffect, otherwise it will run useLayoutEffect.
The useLeaveDetection() hook allows you to detect when a user's cursor leaves the document's boundaries
The useLocalStorage() hook is a quick way to set, read, and manage localStorage values. It comes with automatic JSON serialization/deserialization.
The useMediaQuery() hook allows you to react to media queries inside of your React components. It accepts a media query argument and returns true or false when the query is a match or not with your current browser's properties.
The useMousePosition() hook lets you track the mouse position when hovering over a specific container or the entire page, so if a target container is not provided through the ref, it will track the mouse position relative to the entire document.
The usePrefersTheme() hook allows the detection of the user's preferred system theme
The useScript() hook allows appending script tags to your document from inside React components. The state variable returns a status that can have one of the following values: idle, loading, ready, error.
The useScrollPosition() hook allows you to fetch the window's scroll height/width in real time and to programatically set them by using the provided method.
The useSingleEffect() hook works exactly like useEffect, except it is called only a single time when the component mounts. This helps with React's recent update to the useEffect hook which is being called twice on mount.
The useTitle() hook allows the dynamic update of the document's title from your React components! The title passed to this hook can be attached to a piece of state, updating the state will therefore also update the title.
The useToggle() hook can toggle between a set of two possible values and automatically update the state with the new value, if you want to toggle a boolean's state, see useBoolToggle() below.
The useUpdateEffect() hook will work exactly like a useEffect() hook, except it will skip the first render and only react to changes for values passed inside its dependency array after the initial render.
The useUrgentUpdate() hook forces a component to re-render when it gets called from anywhere inside it.