React hook library, ready to use, written in Typescript.
Created by Julien Caron and maintained with ❤️ by an amazing team of developers.
Initially, usehooks-ts
was a Gatsby powered blog hosted with Github & netlify that publishes easy to understand React Hook code snippets.
But now, it's a monorepo containing:
- A static website used as hooks documentation (Link).
- An NPM package containing the hooks library (Link).
If you'd like to submit new post ideas, improve existing posts, or change anything about the website feel free to submit an issue or pull-request.
useBoolean()
useCopyToClipboard()
useCounter()
useDarkMode()
useDebounce()
useElementSize()
useEventListener()
useFetch()
useHover()
useImageOnLoad()
useIntersectionObserver()
useInterval()
useIsClient()
useIsMounted()
useLocalStorage()
useLockedBody()
useMap()
useOnClickOutside()
useReadLocalStorage()
useScreen()
useScript()
useSsr()
useTimeout()
useWindowSize()
Note: The project uses Node@14
and npm@6
.
Two ways:
- Install
usehooks-ts
from npm to use it in your project. - Install the current whole repository to contribute to it.
npm i usehooks-ts
Then go to the documentation.
# Clone the repository
git clone https://github.com/juliencrn/usehooks-ts.git
cd usehooks-ts
# Install dependencies and setup
npm run bootstrap
# Start (Will start the frontend and the test:watch for the hooks packages)
npm start
# Generate a new hook
npm run plop
# Exec types-checking, linters and tests
npm run test
See more in package.json.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
- Add new hooks
- Develop automated tests for all hooks
- Add a live preview system to interact with hooks
This project is MIT licensed.