svelte-use-click-outside
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i svelte-use-click-outside

Weekly Downloads

1,419

Version

1.0.0

License

MIT

Unpacked Size

3.69 kB

Total Files

8

Last publish

Collaborators

  • th1nkk1d