# hookli > hookli is a zero-dependency, fully-typed, SSR-safe React hooks library — 65 hooks for state, effects, the DOM and data. Install with `npm i hookli`. Every hook is typed, tree-shakeable and works with React Server Components. ## Docs - [hookli home](https://hookli.vercel.app): Every hook you rewrite — typed, SSR-safe, zero dependencies. - [Documentation](https://hookli.vercel.app/docs): Live docs for all 65 hooks. - [Full text for LLMs](https://hookli.vercel.app/llms-full.txt): Every hook's signature, usage and source in one file. - [npm](https://www.npmjs.com/package/hookli): The published package. - [GitHub](https://github.com/saifmohamedsv/hookli): Source, issues and contributions. ## Hooks - [useToggle](https://hookli.vercel.app/docs/use-toggle): Boolean state with toggle and explicit set. - [useForm](https://hookli.vercel.app/docs/use-form): Controlled form state with one change handler. - [useLocalStorage](https://hookli.vercel.app/docs/use-local-storage): State persisted to localStorage. - [useLocalStorageWithExpiry](https://hookli.vercel.app/docs/use-local-storage-with-expiry): Persisted state with a TTL. - [useSessionStorage](https://hookli.vercel.app/docs/use-session-storage): useState backed by sessionStorage, synced across tabs. - [useReadLocalStorage](https://hookli.vercel.app/docs/use-read-local-storage): Read a localStorage key without writing it, reactively. - [useDarkMode](https://hookli.vercel.app/docs/use-dark-mode): Dark-mode boolean with toggle. - [useTernaryDarkMode](https://hookli.vercel.app/docs/use-ternary-dark-mode): Three-state dark mode — system, dark or light — persisted. - [useBoolean](https://hookli.vercel.app/docs/use-boolean): Boolean state with setTrue, setFalse, toggle and set. - [useCounter](https://hookli.vercel.app/docs/use-counter): Numeric counter with increment, decrement and reset. - [useStep](https://hookli.vercel.app/docs/use-step): 1-indexed step counter for wizards and steppers. - [useCountdown](https://hookli.vercel.app/docs/use-countdown): Self-stopping countdown or count-up timer. - [useMap](https://hookli.vercel.app/docs/use-map): Manage a Map as immutable React state. - [useDebounce](https://hookli.vercel.app/docs/use-debounce): Debounces a changing value. - [useDebounceValue](https://hookli.vercel.app/docs/use-debounce-value): State whose debounced copy updates after a pause. - [useDebounceCallback](https://hookli.vercel.app/docs/use-debounce-callback): Debounces a callback, with cancel, flush and isPending. - [useInterval](https://hookli.vercel.app/docs/use-interval): Runs a callback on a fixed interval; pause by passing null. - [useTimeout](https://hookli.vercel.app/docs/use-timeout): Runs a callback once after a delay; cancel by passing null. - [useIsomorphicLayoutEffect](https://hookli.vercel.app/docs/use-isomorphic-layout-effect): useLayoutEffect on the client, useEffect on the server. - [useEventCallback](https://hookli.vercel.app/docs/use-event-callback): A stable callback that always calls the latest closure. - [useUnmount](https://hookli.vercel.app/docs/use-unmount): Runs a cleanup function once, when the component unmounts. - [useIsClient](https://hookli.vercel.app/docs/use-is-client): Reports false on the server and true after hydration. - [useIsMounted](https://hookli.vercel.app/docs/use-is-mounted): A stable getter for whether the component is still mounted. - [useDocumentTitle](https://hookli.vercel.app/docs/use-document-title): Keeps document.title in sync with a value, SSR-safe. - [useEventListener](https://hookli.vercel.app/docs/use-event-listener): Subscribe to a window, document or element event with cleanup. - [useClickOutside](https://hookli.vercel.app/docs/use-click-outside): Runs a callback on outside click. - [useMousePosition](https://hookli.vercel.app/docs/use-mouse-position): Cursor coordinates within an element. - [useInfiniteScroll](https://hookli.vercel.app/docs/use-infinite-scroll): Triggers loading near the scroll end. - [useExpandableText](https://hookli.vercel.app/docs/use-expandable-text): Collapse long text by a character and/or line budget with a show-more toggle. - [useHover](https://hookli.vercel.app/docs/use-hover): Tracks whether the pointer is hovering an element. - [useIntersectionObserver](https://hookli.vercel.app/docs/use-intersection-observer): Observe an element's viewport intersection reactively. - [useResizeObserver](https://hookli.vercel.app/docs/use-resize-observer): Measure an element's size reactively via ResizeObserver. - [useScrollLock](https://hookli.vercel.app/docs/use-scroll-lock): Lock and restore scrolling on the body or an element. - [useClickAnyWhere](https://hookli.vercel.app/docs/use-click-any-where): Run a handler on every click anywhere in the document. - [useMediaQuery](https://hookli.vercel.app/docs/use-media-query): Tracks whether a CSS media query currently matches. - [useScreen](https://hookli.vercel.app/docs/use-screen): Tracks window.screen, refreshing it on every resize. - [useWindowSize](https://hookli.vercel.app/docs/use-window-size): Tracks the viewport's { width, height }, updated on resize. - [useCopyToClipboard](https://hookli.vercel.app/docs/use-copy-to-clipboard): Copy text to the clipboard, tracking the last copied value. - [useScript](https://hookli.vercel.app/docs/use-script): Load an external script and report its load status. - [useFetch](https://hookli.vercel.app/docs/use-fetch): Declarative fetch with loading and error status. - [useGeoLocation](https://hookli.vercel.app/docs/use-geo-location): Browser geolocation state. - [usePrevious](https://hookli.vercel.app/docs/use-previous): Track a value from the previous render. - [useList](https://hookli.vercel.app/docs/use-list): Array state with push, insert, update, remove, and clear helpers. - [useSet](https://hookli.vercel.app/docs/use-set): Set state with add, remove, toggle, has, and clear helpers. - [useThrottle](https://hookli.vercel.app/docs/use-throttle): Throttle a fast-changing value to at most one update per interval. - [useUpdateEffect](https://hookli.vercel.app/docs/use-update-effect): A useEffect that skips the initial mount and runs only on updates. - [useEffectOnce](https://hookli.vercel.app/docs/use-effect-once): Run an effect exactly once, on mount. - [useKeyPress](https://hookli.vercel.app/docs/use-key-press): Track whether a specific key is currently held down. - [useWindowScroll](https://hookli.vercel.app/docs/use-window-scroll): Track the window scroll position reactively. - [useAsync](https://hookli.vercel.app/docs/use-async): Run an async function and track its loading, error, and value state. - [useMutation](https://hookli.vercel.app/docs/use-mutation): Run an async write action on demand and track status, data, and error. - [usePagination](https://hookli.vercel.app/docs/use-pagination): Page, page size, total pages, navigation helpers, and the current item range. - [useNetworkState](https://hookli.vercel.app/docs/use-network-state): Track online/offline status and connection details. - [usePageVisibility](https://hookli.vercel.app/docs/use-page-visibility): Track whether the page/tab is currently visible. - [useIdle](https://hookli.vercel.app/docs/use-idle): Detect user inactivity after a configurable threshold. - [useQueue](https://hookli.vercel.app/docs/use-queue): FIFO queue state with add, remove, clear, and first/last/size. - [useDefault](https://hookli.vercel.app/docs/use-default): useState that falls back to a default when the value is nullish. - [useRafState](https://hookli.vercel.app/docs/use-raf-state): useState whose updates are batched to the next animation frame. - [useDeepCompareEffect](https://hookli.vercel.app/docs/use-deep-compare-effect): useEffect that compares dependencies by deep structural equality. - [useTextSelection](https://hookli.vercel.app/docs/use-text-selection): Track the text the user has currently selected on the page. - [useLongPress](https://hookli.vercel.app/docs/use-long-press): Detect a long press (mouse or touch) via spreadable handlers. - [useHotkeys](https://hookli.vercel.app/docs/use-hotkeys): Bind a keyboard shortcut combo (e.g. ctrl+k) to a callback. - [useFullscreen](https://hookli.vercel.app/docs/use-fullscreen): Control the Fullscreen API for an element and track its state. - [useBattery](https://hookli.vercel.app/docs/use-battery): Read device battery level and charging state (where supported). - [usePermission](https://hookli.vercel.app/docs/use-permission): Query a Permissions API permission and track its state.