Custom Hooks

Collection of custom React hooks for common functionality across the application.

useClipboard

Utility

Usage

Hook for copying text to clipboard with status feedback.

TYPESCRIPT

useKeyPress

Keyboard

Usage

Hook for handling keyboard shortcuts and key press events.

TYPESCRIPT

useIsMobile

Responsive

Usage

Hook for detecting mobile viewport (below 768px).

TYPESCRIPT

useOS

Platform

Usage

Hook for detecting the user's operating system.

TYPESCRIPT

useThemeToggle

Theme

Usage

Hook for managing theme toggling functionality.

TYPESCRIPT

useUpgradeModal

UI

Usage

Hook for managing upgrade modal state with URL query parameters.

TYPESCRIPT

Key Features

⚛️

React Integration

Seamless integration with React's lifecycle and state management

🔄

Type Safety

Full TypeScript support with proper type definitions

📱

Cross-Platform

Works across different devices and environments

🧩

Composable

Can be combined with other hooks for complex functionality

Best Practices

  • 1
    All hooks are client-side only
  • 2
    Use with appropriate error boundaries
  • 3
    Consider SSR implications when using browser APIs
  • 4
    Follow React hooks rules and conventions