@thibault.sh/hooks

v0.0.2

A collection of performant React hooks for common use cases. Built with TypeScript for reliability and developer experience. These hooks are designed to solve real-world problems while maintaining excellent performance and bundle size.

Whether you're building a small application or a large-scale project, these hooks provide reliable solutions for state management, browser APIs, UI interactions, and more. Each hook is thoroughly tested and optimized for production use.

Quick Start

Getting started is simple. Install the package using your preferred package manager, and you'll have immediate access to all hooks. Each hook is individually documented with examples and TypeScript definitions.

1. Install the package

npm install @thibault.sh/hooks

2. Import and use

import { useLocalStorageState } from '@thibault.sh/hooks';

function App() {
  const [theme, setTheme] = useLocalStorageState('theme', 'light');
  return (
    <button onClick={() => setTheme(current => current === 'light' ? 'dark' : 'light')}>
      Toggle theme
    </button>
  );
}

Features

These hooks are built with modern development practices in mind, focusing on reliability, type safety, and seamless integration with your existing React applications.

  • TypeScript Support

    Enjoy full type safety and autocompletion in your IDE. Every hook is written in TypeScript with detailed type definitions and generic support where applicable.

  • Zero Dependencies

    Keep your project lightweight with hooks that have zero external dependencies. This ensures minimal bundle size impact and reduces potential security vulnerabilities.

  • Tree Shakeable

    Import only what you need. Each hook is individually exported, allowing modern bundlers to eliminate unused code and optimize your final bundle size.

  • SSR Compatible

    Built with server-side rendering in mind, these hooks work seamlessly with Next.js, Remix, and other SSR frameworks. Includes proper hydration handling and browser API detection.