Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 days 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-24T19:43:43.000Z (7 months ago)
- Last Synced: 2024-10-30T01:05:10.407Z (15 days 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
[![npm version](https://flat.badgen.net/npm/v/svelte-outside?color=orange)](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!
```