# @vex-ui/toast

> A simple and customizable toast notification system for Vue 3 applications.

Latest version **0.0.2** (published 2024-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vex-ui/toast
pnpm add @vex-ui/toast
yarn add @vex-ui/toast
bun add @vex-ui/toast
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2024-01-02 |
| First published | 2024-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shareef Hassan |
| Maintainers | sherif414 |
| Keywords | vue, vue3, notification, toast, vex |

## Links

- npm: https://www.npmjs.com/package/@vex-ui/toast
- npm.io page: https://npm.io/package/@vex-ui/toast

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^3.4.3
- [@vueuse/core](https://npm.io/package/@vueuse/core.md) ^10.7.1

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2024-01-02
- 0.0.1 — 2024-01-02

## README

# Vex Toast

this is a small unstyled toast service library for Vue 3.

## installation

```sh
pnpm i @vex-ui/toast
```

## usage

1. register the plugin in your app.

```ts
import { createApp } from 'vue'
import VexPlugin from '@vex/toast'

const app = createApp()
app.use(VexPlugin, {})
app.mount()
```

2. use the `useToast` composable to access the `toastify` and `toasts` data,
   then use the `Toast` and `ToastProvider` components to display the toasts, use `dismiss` function to dismiss them.

```tsx
import { useToast } from '@vex/toast'
const { toastify, toasts, dismiss } = useToast()

<template>
  <ToastProvider>
    <Toast
      @timer-end="dismiss(item.uuid)"
      v-for="item in toasts"
      v-bind="item"
      :key="item.uuid"
    />
  </ToastProvider>
</template>
```

3. use the `toastify` function to display a toast.

```tsx
import { useToast } from '@vex/toast'
const { toastify, toasts } = useToast()

// anything you pass on the first argument will be available inside item.meta in the template.
toastify({ message: 'Hello!' }, { duration: 3000 })

<template>
  <ToastProvider>
    <Toast
      @timer-end="dismiss(item.uuid)"
      v-for="item in toasts"
      v-bind="item"
      :key="item.uuid"
    >
      <h2>{{ item.meta.message }}</h2>
    </Toast>
  </ToastProvider>
</template>
```

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