Smoking hot notifications for Vue.js
- ⚡️ Lightweight and fast
- 🎨 Beautiful, theme-adaptive toasts (light/dark)
- 🧩 Fully customizable (icons, styles, positions)
- 🔄 Promise & async support
- 🦾 Accessible (ARIA live regions)
- 🪶 No dependencies, headless & styled components
npm install @retronew/vue-hot-toast
# or
yarn add @retronew/vue-hot-toast
# or
pnpm add @retronew/vue-hot-toast- Register the Toaster component (usually in your root component):
<script setup>
import { Toaster } from '@retronew/vue-hot-toast'
</script>
<template>
<Toaster />
<!-- ...your app -->
</template>- Show a toast anywhere in your app:
import toast from '@retronew/vue-hot-toast'
toast('Hello, world!')
toast.success('Operation completed successfully!')
toast.error('Something went wrong.')
toast.loading('Loading...')- Promise usage:
toast.promise(
fetch('/api/data'),
{
loading: 'Loading...',
success: 'Data loaded!',
error: 'Could not load data',
}
)- Custom toast:
toast.custom(t => h('div', { class: 'my-toast' }, 'Custom content'))- Position & direction:
<Toaster position="top-center" :reverse-order="true" />top-left,top-center,top-rightbottom-left,bottom-center,bottom-right
toast(message, options?)toast.success(message, options?)toast.error(message, options?)toast.loading(message, options?)toast.custom(renderFn, options?)toast.promise(promise, { loading, success, error }, options?)toast.dismiss(id?)— Dismiss a toast or all toaststoast.remove(id?)— Remove a toast or all toasts
position— Toast position (default:top-center)reverseOrder— Show newest on top (default:true)gutter— Space between toasts (default:8)offset— Distance from screen edge (default:16)toastOptions— Default options for all toasts
- Fork this repo
- Create your feature branch (
git checkout -b feat/my-feature) - Commit your changes (
git commit -am 'feat: add new feature') - Push to the branch (
git push origin feat/my-feature) - Open a Pull Request