svelte-use-click-outside
v1.0.0
Published
Zero dependency Svelte's action to handle click outside event
Downloads
4,627
Readme
svelte-use-click-outside
Zero dependency Svelte's action to handle click outside event
Installation
npm -i svelte-use-click-outside
Usage
<script>
import { clickOutside } from 'svelte-use-click-outside';
function clickOutsideHandler() {
// handler logic
}
</script>
<div use:clickOutside={clickOutsideHandler} />
Inspired by https://svelte.dev/repl/0ace7a508bd843b798ae599940a91783