🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

hookbase

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hookbase

A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects.

npmnpm
Version
0.1.9
Version published
Weekly downloads
15
114.29%
Maintainers
1
Weekly downloads
 
Created
Source

📦 React Reusable Hooks

A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects.

🚀 Installation

npx hookbase

📖 Usage

Import the hooks you need directly from the package:

import { useBoolean } from "@/hooks/use-boolean";

function App() {
  const { value, toggle } = useBoolean();

  return (
    <div>
      <button onClick={toggle}>Toggle</button>
      {value && <div>Value is true</div>}
    </div>
  );
}

🛠️ Available Hooks

useBoolean useCopyToClipboard useDocumentTitle useInterval useIsomorphicLayoutEffect useTimeout useToggle useUnmount useCounter useMousePosition

Here are some of the included hooks (expand as needed):

  • useDebounce(value, delay) → Debounces a value by the given delay.
  • useLocalStorage(key, initialValue) → Persist state in localStorage.
  • usePrevious(value) → Get the previous value of a state or prop.
  • useOnClickOutside(ref, handler) → Detect clicks outside of a given element.
  • useFetch(url, options) → Simplify data fetching with built-in loading and error states.

📜 License

This project is licensed under the MIT License.

Documentation

Coming soon

FAQs

Package last updated on 27 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts