Hooks
Browse all available hooks in Hookstorm, organized by category.
State & UI
| Hook | Description |
|---|---|
| useToggle | Toggle a boolean with an optional forced value |
| useCounter | Increment, decrement, and reset a counter |
| usePrevious | Access the previous value of any state or prop |
| useDebounce | Delay a value update until input settles |
DOM & Browser
| Hook | Description |
|---|---|
| useWindowSize | Track current window width and height |
| useScrollPosition | Read the current scroll position |
| useMousePosition | Track cursor position in real time |
| useHover | Detect hover state on any element |
| useClickOutside | Detect clicks outside a referenced element |
| useDocumentTitle | Dynamically update the browser tab title |
| useLockScroll | Prevent or restore page scroll |
| useKeyPress | Detect when a specific key is held down |
| useEventListener | Attach an event listener to window or any element |
| useMediaQuery | Track whether a CSS media query matches |
| useIntersectionObserver | Detect when an element enters or leaves the viewport |
| useResizeObserver | Track the dimensions of a DOM element |
Storage
| Hook | Description |
|---|---|
| useLocalStorage | localStorage with a React state interface |
| useSessionStorage | sessionStorage with a React state interface |
| useCookie | Read, write, and remove cookies |
Network & Device
| Hook | Description |
|---|---|
| useOnlineStatus | Detect online / offline status |
| useGeoLocation | Request and track user geolocation |
| usePageVisibility | Know when the user switches away from the tab |
| usePrefersTheme | Read the OS prefers-color-scheme setting |
Timers & Async
| Hook | Description |
|---|---|
| useCountdown | Countdown timer with start, stop, and reset |
| useIdle | Detect inactivity after a configurable timeout |
| useAsync | Manage async function lifecycle with loading, data, and error |
| useInterval | Declarative setInterval with pause support |
| useTimeout | Declarative setTimeout with reset and clear |
| useMounted | Ref-based mount guard for safe async state updates |