# @stradox/vue3-useclickoutside

> Use a callback to run actions when a user clicks outside an element

Latest version **0.0.5** (published 2023-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stradox/vue3-useclickoutside
pnpm add @stradox/vue3-useclickoutside
yarn add @stradox/vue3-useclickoutside
bun add @stradox/vue3-useclickoutside
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-09-24 |
| First published | 2023-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Umar Adejoh |
| Maintainers | stradox |
| Keywords | click, outside, click outside, vue, vue3 |

## Links

- npm: https://www.npmjs.com/package/@stradox/vue3-useclickoutside
- Repository: https://github.com/stradox4u/vue3-useclickoutside
- Homepage: https://github.com/stradox4u/vue3-useclickoutside#readme
- Issues: https://github.com/stradox4u/vue3-useclickoutside/issues
- npm.io page: https://npm.io/package/@stradox/vue3-useclickoutside

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2023-09-24
- 0.0.4 — 2023-09-24
- 0.0.3 — 2023-09-23
- 0.0.2 — 2023-09-23
- 0.0.1 — 2023-09-23

## README

# Vue3-UseClickOutside

A Vue 3 composable that allows you to run actions when clicking outside an element. Useful for closing modals, dropdowns, etc.

## Installation

```bash
$ npm install @stradox/vue3-useclickoutside
```

## Usage

```vue
<script setup lang="ts">
import { ref } from 'vue';
import { useClickOutside } from '@stradox/vue3-useclickoutside';

const relevantRef = ref<HTMLElement | null>(null);

useClickOutside(relevantRef, () => {
  // do something
});
</script>

<template>
  <div>
    <div ref="relevantRef">Click outside me</div>
  </div>
</template>
```

---
_Source: https://npm.io/package/@stradox/vue3-useclickoutside · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
