Vue

HelperVue 3 helper export with optional Toaster, Vue-aware toast, and custom() for VNodes. For a live demo and install snippet, see the Vue landing.

<script setup>
import { toast, Toaster, custom } from "alert-notify/vue";
import { h } from "vue";
</script>

<template>
  <Toaster position="top-right" :rich-colors="true" />
  <button @click="toast.success('Saved')">Save</button>
  <button
    @click="
      toast.info('Pay with card', {
        icon: h('img', { src: '/card.png', alt: '' }),
      })
    "
  >
    With icon
  </button>
  <button @click="custom(h('div', 'Custom Vue content'))">Custom</button>
</template>