Hooks
React hooks for common UI tasks. Install one with the CLI and use it in your components.
All hooks
useCopyToClipboard
NEWCopy text with a copied state and a fallback for http
useDeferredInteraction
NEWFlag that turns on after the first user interaction or a timeout
useFileDrop
NEWDrag-and-drop files onto any element, with accept filtering
useHorizontalWheel
NEWVertical mouse wheel scrolls a horizontal row
useKeyboardFit
NEWOn-screen keyboard height from visualViewport as a value and CSS vars
useKeyboardLayout
NEWSpot text typed on the wrong keyboard layout and fix it
useNearViewport
NEWOne-shot flag for elements that come close to the screen
useNotificationPermission
NEWBrowser notification permission with quiet days
useNow
NEWCurrent time on a shared interval, safe for hydration
useScrollSpy
NEWReturns the id of the section currently in view
useScrollThreshold
NEWScrolled-past-threshold flag with hysteresis for sticky headers
useSoundEffects
NEWInterface sounds synthesized with Web Audio, no audio files