A comprehensive collection of React hooks for browser storage, UI interactions, and more
npm install @thibault.sh/hooksA collection of performant React hooks for common use cases. Built with TypeScript.
``bash`
npm install @thibaultsh/hooks
- Persist state in localStorage - Session storage state management - Cookie state management - URL query parameters state - Detect clicks outside elements - Track element hover state - Keyboard input handling - Keyboard shortcuts - Long press detection - Responsive design helper - Window dimensions tracking - Scroll position tracking - Container scroll management - Element size observer - Viewport intersection - Element resize detection - Async operation wrapper - Countdown timer to target date - Value debouncing - Action throttling - Interval handling - Event subscription`tsx
import { useLocalStorageState, useMediaQuery } from '@thibault.sh/hooks';
function App() {
const [theme, setTheme] = useLocalStorageState<'light' | 'dark'>('theme', 'light');
const isMobile = useMediaQuery('(max-width: 768px)');
return (
For detailed documentation, visit thibault.sh/hooks
MIT © Thibault Mathian