DocsGetting started
How it works139 hooksby Hiren Gohel

Getting started

This page explains how to work with AllHook — find the right hook, understand the guide, try it live, then use it in your React app the right way.

  1. Find the hook for your problem

    Don't memorize 139 names. Start from what you are building, then open the matching guide.

    Tip: ⌘K / Ctrl+K

    Open search from any page and jump straight to a hook, use case, or docs page.

  2. Read a guide like a playbook

    Every hook page follows the same structure so you know where to look.

    Import + APISignature, when to use, SSR / Next.js notes
    Live playgroundChange the example and see it run instantly
    Implementation sourceFull hook file — copy if you need the real source
    Example + checklistPaste-ready usage and production tips
  3. Use it in your React app

    Hooks must follow React rules. In Next.js App Router, the file that calls them needs a client boundary.

    components/Drawer.tsx
    'use client';
    
    import { useToggle } from '@/hooks';
    // or: import { useToggle } from '../hooks/useToggle';
    
    export function Drawer() {
      const [open, toggle] = useToggle(false);
    
      return (
        <>
          <button type="button" onClick={() => toggle()}>
            {open ? 'Close' : 'Open'}
          </button>
          {open ? <aside>Drawer content</aside> : null}
        </>
      );
    }
    • Call hooks only inside React function components or other custom hooks — never in plain functions, loops, or conditions
    • Next.js App Router: add 'use client' at the top of any file that uses hooks
    • Fill in generics when the API needs them (e.g. useFetch<User[]>)
    • Check the guide's SSR badge and notes — browser APIs no-op until the client mounts
  4. Copy what you need

    Prefer the full example block from the guide or cheatsheet — it includes import + usage. Use Copy code so you get the entire snippet, not just one line.

    About @/hooks in examples

    Docs examples import from @/hooks because that is how this site resolves the library. In your project, import from the path where you keep the hook files (same idea, your own alias or relative path).

  5. See hooks working together

    When one guide is not enough, open Hooks in action or a use-case page — real UI patterns composed from several hooks.

Try it on a real guide

Open one, skim API + playground, then copy the example into your app.