https://github.com/propolies/svelte-outside
A svelte use directive for clicking/tapping outside an element.
https://github.com/propolies/svelte-outside
Last synced: 2 months ago
JSON representation
A svelte use directive for clicking/tapping outside an element.
- Host: GitHub
- URL: https://github.com/propolies/svelte-outside
- Owner: propolies
- Created: 2024-04-24T15:15:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-24T19:43:43.000Z (about 1 year ago)
- Last Synced: 2024-10-30T01:05:10.407Z (8 months ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Svelte-outside
[](https://npmjs.com/package/svelte-outside)
A svelte use directive for click/tap outside an element.
## Installation
```bash
npm install svelte-outside
```## Usage
**Click outside**
```svelteimport { clickOutside } from "svelte-outside"
console.log("Clicked outside!")}>
Click outside me!
```**Tap outside**
```svelteimport { tapOutside } from "svelte-outside"
console.log("Tap outside!")}>
Tap outside me!
```