SSE Hooks

useHover

Custom hook that tracks whether a DOM element is being hovered over.

Installation

npx sse-tool add use-hover

Usage

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

NameTypeDescription
elementRefRefObjectThe ref object for the DOM element to track.

Return Value

Returns boolean.

A boolean value indicating whether the element is being hovered over.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026