Features
Everything you want from a hooks library — without the ceremony.
Lightweight
No heavy dependencies — just focused hooks that keep your bundle lean.
Type-Safe
First-class TypeScript types catch mistakes early and improve editor DX.
Tree-Shakable
Import only what you need. Unused hooks stay out of the final build.
Easy to Use
Small, predictable APIs with clear docs and copy-paste ready examples.
Developer-Friendly
Solve common React problems once, then reuse the pattern across projects.
Open Source
MIT licensed and open to contributions — fork it, improve it, ship it.
Available hooks
18 focused hooks for everyday React work. Pick one and jump straight into the docs.
useBoolean
Manage boolean state with handy helpers.
Open docsuseCopyToClipboard
Copy text to the clipboard with feedback.
Open docsuseCountdown
Run a countdown timer with start and reset.
Open docsuseCounter
Increment, decrement, and reset a counter.
Open docsuseDarkMode
Toggle and persist light/dark preference.
Open docsuseDebounce
Debounce a rapidly changing value.
Open docsuseHover
Track whether an element is hovered.
Open docsuseIsomorphicLayoutEffect
SSR-safe layout effect alias.
Open docsuseLocalStorage
Persist state in localStorage.
Open docsuseMediaQuery
React to CSS media query matches.
Open docsuseNetworkStatus
Know when the browser is online.
Open docsuseOnScreen
Detect when an element enters the viewport.
Open docsusePrevious
Keep the previous value of a variable.
Open docsuseSessionStorage
Persist state in sessionStorage.
Open docsuseSlugify
Turn strings into URL-friendly slugs.
Open docsuseThrottle
Throttle updates to a given interval.
Open docsuseTimeout
Declarative wrapper around setTimeout.
Open docsuseToggle
Toggle between two values with ease.
Open docsFree, forever
hooks-ts is MIT licensed and open source. Use it in side projects or production apps — then star the repo if it saved you time.