Skip to content

@erag/vue-toastificationLightweight Toast & Modal Library for Vue 3

Trigger clean, non-blocking toast notifications and await confirmation dialog decisions natively with a clean promise-based API.

Vue Toastification Logo

Quick Showcase & Code Examples

Get up and running with @erag/vue-toastification in seconds. Check out the core code structures below to see how to initialize, notify, and await modal decisions.

typescript
import ToastPlugin from '@erag/vue-toastification'
import '@erag/vue-toastification/dist/style.css'

app.use(ToastPlugin, {
  position: 'bottom-right'
})
typescript
import { useToast } from '@erag/vue-toastification'

const { success, error } = useToast()

success('Changes saved!', 'Success')
error('Something went wrong.', 'Error')
typescript
import { useModal } from '@erag/vue-toastification'

const modal = useModal()

const confirmed = await modal.confirm({
  title: 'Delete Resource?',
  message: 'This is permanent.',
  type: 'danger'
})

Frequently Asked Questions

Why use this package over standard vue-toastification libraries?

Unlike other heavy notification libraries, @erag/vue-toastification combines both non-blocking toasts and interactive promise-based modal dialogs in a single lightweight package with zero external dependencies and complete typescript integration.

How does the Promise-based modal system function?

When you trigger modal.confirm(), the library mounts a confirmation overlay and returns a native JS Promise. Clicking 'Confirm' resolves the promise to true, and clicking 'Cancel' resolves it to false. This allows you to write clean, linear async/await logic directly in your script setup.

Are layout positions fully configurable?

Yes. You can specify a default global position (e.g. bottom-right, top-center) during plugin setup, and dynamically override it on individual triggers whenever you need specific alerts positioned differently.

How is style contamination prevented?

All CSS layout selectors used by the package are strictly prefixed with erag-. This guarantees that importing the stylesheet won't override or affect standard styling variables in Tailwind, Bootstrap, or custom stylesheets.

MIT License. Copyright Er Amit Gupta