npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-toastify-mini

v1.0.0

Published

A lightweight toast notification library for Vue 3

Downloads

5

Readme

Vue Toastify Mini

A lightweight toast notification library for Vue 3 and TypeScript.

Features

  • 🚀 Simple and lightweight
  • 🎨 Customizable themes (light/dark)
  • 📱 Multiple positions support
  • ⏱️ Auto-close with progress bar
  • 🔄 Promise-based toasts
  • 🎭 Custom component support
  • 🌓 Light and dark themes
  • 🎬 Smooth animations (fade/slide)

Installation

npm install vue-toastify-mini

or

yarn add vue-toastify-mini

Usage

Register as a plugin (recommended)

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import ToastifyMini from 'vue-toastify-mini'
import 'vue-toastify-mini/dist/vue-toastify-mini.css'

const app = createApp(App)

app.use(ToastifyMini, {
  maxToasts: 3,
  defaultPosition: 'top-right',
  defaultDuration: 3000,
  defaultTheme: 'light'
})

app.mount('#app')

Use in components

<script setup lang="ts">
import { useToastify } from 'vue-toastify-mini'

const toast = useToastify()

function showToast() {
  toast.success('This is a success message!', {
    position: 'top-right',
    duration: 3000,
    theme: 'light'
  })
}
</script>

<template>
  <button @click="showToast">Show Toast</button>
</template>

Global instance

If you registered the plugin, you can access the toast instance globally:

<script setup lang="ts">
// Access the global toast instance
function showToast() {
  // @ts-ignore - TypeScript doesn't know about $toast
  this.$toast.success('This is a success message!')
}
</script>

API

Toast Types

// Success toast
toast.success(message, options)

// Error toast
toast.error(message, options)

// Info toast
toast.info(message, options)

// Warning toast
toast.warning(message, options)

// Custom component toast
toast.custom(component, options)

// Promise-based toast
toast.promise(promise, {
  loading: 'Loading...',
  success: 'Success!',
  error: 'Error!',
  options: { /* toast options */ }
})

Toast Options

interface ToastOptions {
  // Position of the toast
  position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left';
  
  // Duration in milliseconds before auto-closing (0 to disable)
  duration?: number;
  
  // Whether to show close button
  closeButton?: boolean;
  
  // Custom icon component or string
  icon?: Component | string;
  
  // Theme of the toast
  theme?: 'light' | 'dark';
  
  // Animation type
  animation?: 'fade' | 'slide';
  
  // Custom CSS class for the toast
  className?: string;
  
  // Callback function when toast is closed
  onClose?: () => void;
  
  // Callback function when toast is clicked
  onClick?: () => void;
}

Container Options

When registering the plugin, you can configure the container:

app.use(ToastifyMini, {
  // Maximum number of toasts per position
  maxToasts: 3,
  
  // Default position for toasts
  defaultPosition: 'top-right',
  
  // Default duration for toasts
  defaultDuration: 3000,
  
  // Default theme for toasts
  defaultTheme: 'light'
})

Toast Management

// Dismiss a specific toast by ID
const id = toast.success('Message')
toast.dismiss(id)

// Dismiss all toasts
toast.dismissAll()

Customization

Custom Components

You can use custom Vue components as toast content:

const CustomComponent = {
  template: `
    <div>
      <h3>Custom Component</h3>
      <p>This is a custom component toast!</p>
      <button @click="$emit('action')">Click me</button>
    </div>
  `,
  setup() {
    return {
      action: () => {
        alert('Custom action triggered!')
      }
    }
  }
}

toast.custom(CustomComponent, {
  position: 'top-center',
  duration: 0, // Won't auto-close
  closeButton: true
})

Promise-based Toasts

Show different toasts based on promise state:

const fetchData = async () => {
  // Your async operation
  return await api.getData()
}

toast.promise(fetchData(), {
  loading: 'Loading data...',
  success: 'Data loaded successfully!',
  error: 'Failed to load data!',
  options: {
    position: 'bottom-center'
  }
})

License

MIT