MCPcopy
hub / github.com/imbhargav5/rooks

github.com/imbhargav5/rooks @9.8.0 sqlite

repository ↗ · DeepWiki ↗ · release 9.8.0 ↗
738 symbols 2,238 edges 319 files 149 documented · 20%
README

Why Rooks ?

CI and Semantic Release GitHub release (latest by date) GitHub Codecov branch

npm npm bundle size Module node-lts

GitHub contributors Website GitHub stars

Collection of awesome react hooks

<a target="_blank" rel="noopener noreferrer" href="https://vercel.com?utm_source=rooks&utm_campaign=oss"

⚠️ Contributing Notice

We are currently only accepting contributions from verified contributors. If you wish to contribute, please open an issue first to discuss your proposed changes.

📚 Table of Contents

🚀 Quick Start

Get up and running in seconds:

npm install rooks
# or
yarn add rooks
# or
pnpm add rooks

Import any hook and start using it:

import { useDidMount, useCounter, useToggle } from "rooks";

function App() {
  const { value, increment, decrement } = useCounter(0);
  const [isOn, toggleIsOn] = useToggle(false);

  useDidMount(() => {
    console.log("Component mounted! 🎉");
  });

  return (



      <h1>Count: {value}</h1>
      <button onClick={increment}>Increment</button>
      <button onClick={decrement}>Decrement</button>

      <h2>Toggle is {isOn ? "ON" : "OFF"}</h2>
      <button onClick={toggleIsOn}>Toggle</button>



  );
}

📖 Browse all hooks🎮 Try in CodeSandbox

✨ Why Rooks?

🎯 Focused Each hook does one thing well 📦 Tree-shakeable Import only what you need
🔄 SSR Ready Works with Next.js, Remix, Gatsby 🧪 Well Tested 95%+ code coverage
📚 Documented Every hook has examples & demos TypeScript First Full type safety out of the box
🎨 Modern Built for React 18+ with ESM 🤝 Community Driven 82 contributors and growing

🌟 Popular Hooks

State Management

useCounter Counter with increment/decrement useToggle Toggle between values useLocalstorageState useState with localStorage sync
const { value, increment } = useCounter(0) const [on, toggle] = useToggle() const [user, setUser] = useLocalstorageState('user')

Event Handling

useKey Keyboard event handling useOutsideClick Detect clicks outside element useOnClickRef Click handler with ref

Lifecycle & Effects

useDidMount componentDidMount equivalent useWillUnmount componentWillUnmount equivalent useDebounce Debounce any value

List of all hooks

🎬 Animation & Timing - 10 hooks

  • useAnimation - Animation hook for React
  • useEasing - A hook for creating controlled easing animations with start/stop/reset capabilities.
  • useIntervalWhen - Sets an interval immediately when a condition is true
  • useLockBodyScroll - This hook locks the scroll of the body element when isLocked is set to true.
  • usePrefersReducedMotion - A React hook that returns true if the user has enabled the 'prefers-reduced-motion' setting in their system.
  • useRaf - A continuously running requestAnimationFrame hook for React
  • useResizeObserverRef - Resize Observer hook for React.
  • useSpring - Spring animation hook for React
  • useTimeoutWhen - Takes a callback and fires it when a condition is true
  • useTween - Tween animation hook for React

🌐 Browser APIs - 16 hooks

🛠️ Development & Debugging - 1 hook

🚀 Events - 16 hooks

📝 Form & File Handling - 3 hooks

  • useCheckboxInputState - Simple checkbox state management hook that provides a boolean state and props that can be spread directly onto a checkbox input element
  • useFileDropRef - Drop files easily
  • useFormState - Comprehensive form state management with validation

⌨️ Keyboard & Input - 5 hooks

  • useInput - Input hook for React.
  • useKey - keypress, keyup and keydown event handlers as hooks for react.
  • useKeyBindings - useKeyBindings can bind multiple keys to multiple callbacks and fire the callbacks on key press.
  • useKeyRef - Very similar useKey but it returns a ref
  • useKeys - A hook which allows to setup callbacks when a combination of keys are pressed at the same time.

🔥 Lifecycle & Effects - 11 hooks

  • useAsyncEffect - A version of useEffect that accepts an async function
  • useDebouncedAsyncEffect - A version of useEffect that accepts an async function and debounces its execution based on dependency changes
  • useDebouncedEffect - A version of useEffect that debounces the effect execution based on dependency changes
  • useDeepCompareEffect - Deep compare dependencies instead of shallow for useEffect
  • useDidMount - componentDidMount hook for React
  • [useDidUpdate](https://rooks

Extension points exported contracts — how you extend this code

NetworkInformation (Interface)
* Network connection interface [3 implementers]
packages/rooks/src/hooks/useNetworkInformation.ts
Contributor (Interface)
(no doc)
apps/website/src/components/ContributorList.tsx
Hook (Interface)
(no doc)
scripts/update-package-list-to-markdown/index.ts
FullscreenDocument (Interface)
(no doc) [3 implementers]
packages/rooks/src/hooks/useFullscreen.ts
QueryProviderProps (Interface)
(no doc)
apps/website/src/providers/QueryProvider.tsx
HooksData (Interface)
(no doc)
scripts/update-package-list-to-markdown/index.ts
AnimationOptions (Interface)
* Animation options
packages/rooks/src/hooks/useAnimation.ts
HooksByCategory (Interface)
(no doc)
scripts/update-package-list-to-markdown/index.ts

Core symbols most depended-on inside this repo

removeEventListener
called by 86
packages/rooks/src/hooks/useIdleDetectionApi.ts
addEventListener
called by 85
packages/rooks/src/hooks/useIdleDetectionApi.ts
ref
called by 55
packages/rooks/src/hooks/useOnHoverRef.ts
useCounter
called by 48
packages/rooks/src/hooks/useCounter.ts
useAudio
called by 41
packages/rooks/src/hooks/useAudio.ts
useInput
called by 41
packages/rooks/src/hooks/useInput.ts
useFreshCallback
called by 36
packages/rooks/src/hooks/useFreshCallback.ts
useMultiSelectableList
called by 35
packages/rooks/src/hooks/useMultiSelectableList.ts

Shape

Function 512
Method 99
Interface 85
Class 42

Languages

TypeScript100%

Modules by API surface

packages/rooks/src/hooks/useSuspenseFavicon.ts30 symbols
packages/rooks/src/hooks/useAudio.ts28 symbols
scripts/update-package-list-to-markdown/index.ts23 symbols
packages/rooks/src/hooks/useIdleDetectionApi.ts22 symbols
packages/rooks/src/__tests__/useSuspenseIndexedDBState.spec.tsx22 symbols
packages/rooks/src/__tests__/useBroadcastChannel.spec.tsx18 symbols
packages/rooks/src/hooks/useTemporalAge.ts15 symbols
packages/rooks/src/hooks/useFullscreen.ts15 symbols
packages/rooks/src/hooks/useTemporalNow.ts14 symbols
packages/rooks/src/hooks/useTemporalElapsed.ts14 symbols
packages/rooks/src/hooks/useTemporalCountdown.ts14 symbols
packages/rooks/src/hooks/useSuspenseIndexedDBState.ts12 symbols

Dependencies from manifests, versioned

@babel/cli7.28.6 · 1×
@babel/core7.29.0 · 1×
@babel/plugin-external-helpers7.27.1 · 1×
@babel/plugin-proposal-export-default-from7.27.1 · 1×
@babel/plugin-proposal-unicode-property-regex7.18.6 · 1×
@babel/preset-env7.29.0 · 1×
@babel/preset-react7.28.5 · 1×
@changesets/changelog-github0.6.0 · 1×
@changesets/cli2.30.0 · 1×
@codesandbox/sandpack-react2.20.0 · 1×
@content-collections/cli0.1.9 · 1×
@content-collections/core0.14.2 · 1×

For agents

$ claude mcp add rooks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact