useHover
Custom hook that tracks whether a DOM element is being hovered over.
Installation
npx sse-hooks add use-hover
yarn dlx sse-hooks add use-hover
pnpm dlx sse-hooks add use-hover
deno run -A npm:sse-hooks add use-hover
bunx sse-hooks add use-hover
Usage
example.ts
import { useHover } from "./{hooks file}";
const buttonRef = useRef<HTMLButtonElement>(null);
const isHovered = useHover(buttonRef);
// Access the isHovered variable to determine if the button is being hovered over.
API
Parameters
| Prop | Default | Type |
|---|---|---|
elementRef | - |
The ref object for the DOM element to track. |
Returns
| Return Value | Default | Type |
|---|---|---|
return | - |
Hook return value |
Types Aliases
No specific type aliases defined for this component.
Changelog
useAudioRecorder
A comprehensive hook for audio recording with real-time analysis using getUserMedia, MediaRecorder, and Web Audio APIs
useKey
A powerful sensor hook for handling keyboard shortcuts, sequences, and modifiers. It supports complex key combinations (`Ctrl+Shift+S`), Gmail-style sequences (`g then i`), and provides metadata for generating "Keyboard Shortcut" UI help modals.