Hookagain
A collection of shadcn installable react hooks
- 95
- GitHub stars
- Free
- Price
- May 6, 2025
- Updated
Overview
hookagain is a small collection of reusable React hooks by ilyichv, distributed the same way as shadcn/ui components. Instead of adding a hooks package as a dependency, each hook is installed with the shadcn CLI from its registry URL and copied into the project as source.
The documentation site lists nine hooks covering common browser and timing utilities, plus two hooks for working with Phoenix channels and sockets, which makes it useful for apps that talk to an Elixir Phoenix backend. Each hook has its own docs page.
Features
- useCopyToClipboard: Copies text to the clipboard.
- useDebouncedCallback and useDebouncedValue: Debounce a function call or a changing value.
- useIntersectionObserver: Tracks when an element enters or leaves the viewport.
- useInterval: Runs a callback on a timed interval.
- useLocalStorage: Reads and writes state persisted in local storage.
- useMediaQuery: Reacts to CSS media query matches.
- usePhoenixSocket and usePhoenixChannel: Connect to a Phoenix socket and join channels from React.
Getting started
npx shadcn@latest add https://hookagain.vercel.app/r/<hook-name>.json