hoverAction

Simple way to handle hover action. Uses useHover internally.

Demo

Hover me

Mouse in the element: No!

Usage

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

function handleHover(e: CustomEvent<{ hover: boolean }>) {
  alert(`Box hovered: ${e.detail.hover}`);
}
</script>

<div
  class="box"
  use:hoverAction
  on:hover={handleHover}
/>