Hooks

PreviousNext

Custom React hooks for common patterns and functionality.

Collection of reusable React hooks that solve common problems in modern web applications.

Available Hooks

useDebounceFn

Debounce function calls to improve performance and prevent excessive API calls.

useIsClient

Check if the component is rendered on the client side, useful for SSR/hydration scenarios.

useWarnIfUnsavedChanges

Warn users before leaving the page when there are unsaved changes.

useCopyToClipboard

Copy text to the clipboard with fallback support and feedback state management.

Installation

All hooks can be installed using the shadcn CLI:

pnpm dlx shadcn@latest add https://ui.nowts.app/r/<hook-name>.json

For example:

pnpm dlx shadcn@latest add https://ui.nowts.app/r/use-debounce-fn.json