+67
| # 📦 React Reusable Hooks | ||
| A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects. | ||
| --- | ||
| ## 🚀 Installation | ||
| ```bash | ||
| npx hookbase | ||
| ``` | ||
| --- | ||
| ## 📖 Usage | ||
| Import the hooks you need directly from the package: | ||
| ```tsx | ||
| 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](./LICENSE). | ||
| --- | ||
| ## Documentation | ||
| Coming soon |
+1
-1
| { | ||
| "name": "hookbase", | ||
| "version": "0.1.8", | ||
| "version": "0.1.9", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "bin": { |
-67
| # 📦 React Reusable Hooks | ||
| A collection of reusable React hooks to simplify state management, side effects, and common UI patterns in your projects. | ||
| --- | ||
| ## 🚀 Installation | ||
| ```bash | ||
| npx hookbase | ||
| ``` | ||
| --- | ||
| ## 📖 Usage | ||
| Import the hooks you need directly from the package: | ||
| ```tsx | ||
| 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](./LICENSE). | ||
| --- | ||
| ## Documentation | ||
| Coming soon |