React UI sensor hook that uses Javascript/Typescript instead of CSS to figure out if the mouse element is in the hover element. So, you can separate the logic from the user interface (UI).


Hover me

Mouse in the element: false


<script lang="ts">
import { hoverStore } from "svelte-legos";

let ref: HTMLDivElement | null = null;

$: isHover = hoverStore(ref);

// $isHover will be true/false
// whenever mouse enters/leaves the
// Box

<Box bind:this={ref}></Box>