svelte-outside-click

Svelte Outside Click

Handle clicks outside of your specified element.

Svelte Outside

Svelte Outside allows you to handle click events that occur outside of an element without having to wrap your elements inside of an component.

Basic Usage

Using Svelte Outside is as simple as adding two lines of code.

<div use:clickOutside={handleClickEvent}>
    <p>Nested</p>
</div>

<script>
import clickOutside from "svelte-outside-click";

function handleClickEvent() {
    // Your code here
}
</script>

Top categories

Loading Svelte Themes