Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/usehooks-ts.ts>useHover

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useHover
import { useHover } from "https://deno.land/x/netzo@0.5.107/deps/usehooks-ts.ts";

Custom hook for tracking whether a DOM element is being hovered over.

Examples

const buttonRef = useRef(null); const isHovered = useHover(buttonRef); // Access the isHovered variable to determine if the button is being hovered over.

Type Parameters

optional
T extends HTMLElement = HTMLElement
  • The type of the DOM element. Defaults to HTMLElement.

Parameters

elementRef: RefObject<T>
  • The ref object for the DOM element to track.

Returns

boolean

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