Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt

Use this file to discover all available pages before exploring further.

Typed Hooks is a lightweight collection of fully typed, reusable React hooks built specifically for TypeScript projects. Every hook ships with precise generic types and detailed JSDoc comments so you get instant autocomplete, compile-time error checking, and zero guesswork about what each hook accepts and returns. Rather than installing a heavy dependency and importing the entire library, each hook is copied directly into your codebase via the Shadcn CLI. You own the code — customise it freely, tree-shake it naturally, and never worry about upstream breaking changes.

Available Hooks

useBoolean

Manage boolean state with toggle, setTrue, setFalse, and reset helpers.

useDefault

State with an automatic fallback when the value is null or undefined.

useClipboardCopy

Copy text to the clipboard and track the copy status (idle / success / error).

useDebounce

Delay a value update until a quiet period has elapsed.

useDebouncedCallback

Debounce a callback function with leading, trailing, and maxWait options.

useInterval

Run a callback on a recurring interval with start, stop, and reset controls.

usePrevious

Capture the previous render’s value of any state or prop.

useWindowResize

Track the current window width and height with debounced updates.

useEventListener

Attach type-safe event listeners to any DOM element with delegation support.

useLocalStorage

Persist state in localStorage with JSON serialization and cross-tab sync.

useSessionStorage

Persist state in sessionStorage with JSON serialization and error handling.

useLogger

Advanced, configurable logger with log levels, colours, and grouping.

Installation

Each hook is added individually using the Shadcn CLI. Replace <hook-name> with the kebab-case name of the hook you want:
npx shadcn@latest add https://shaddy-docs.vercel.app/r/<hook-name>
For example, to add useBoolean:
npx shadcn@latest add https://shaddy-docs.vercel.app/r/use-boolean
The command copies the hook’s source file directly into your project. No runtime package is installed — the code is yours from the moment it lands in your repo.

Key Benefits

  • TypeScript-first — Every hook is authored in strict TypeScript with generic parameters and precise return types. Your IDE shows exactly what is accepted and returned.
  • No package install — Hooks are copied into your codebase, keeping your node_modules lean and giving you full control over the implementation.
  • Modular — Add only the hooks you need. Because each file is independent, unused hooks carry zero bundle cost.
  • Battle-tested — Each hook follows React best practices: stable callback references with useCallback, proper cleanup in useEffect, and safe server-side rendering guards.
  • Developer friendly — Simple, composable APIs with helpful JSDoc comments that surface in your editor as you type.

Build docs developers (and LLMs) love