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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue3-confirm-modal

v1.0.0

Published

Advanced reusable confirm modal plugin for Vue 3 with TailwindCSS, supporting custom icons, slots, background blur, and keyboard accessibility.

Readme

vue3-confirm-modal

Advanced reusable Confirm Modal plugin/component for Vue 3 with Tailwind CSS.

  • Customizable titles, messages, icons, buttons
  • Supports slots for icon, message, extra content, footer
  • Background blur + disables outside clicks
  • Keyboard accessible (Enter/Escape) and focus trapped
  • Promise-based global $confirm() API

Installation

npm install vue3-confirm-modal
# or
yarn add vue3-confirm-modal

Usage

1. Register globally in your Vue app

import { createApp } from 'vue'
import App from './App.vue'
import ConfirmPlugin from 'vue3-confirm-modal'

const app = createApp(App)
app.use(ConfirmPlugin)
app.mount('#app')

2. Use $confirm() in any component

export default {
  methods: {
    async deleteItem() {
      const confirmed = await this.$confirm({
        title: 'Delete Item?',
        message: 'Are you sure you want to delete this? This action cannot be undone.',
        confirmText: 'Delete',
        cancelText: 'Cancel',
        icon: 'error', // options: info, success, warning, error
      })

      if (confirmed) {
        // proceed with deletion
        console.log('Item deleted')
      } else {
        console.log('Deletion cancelled')
      }
    }
  }
}

Slots Support (Advanced)

You can pass custom content for icon, message, extra area, and footer buttons.

Example (in setup script):

import { h } from 'vue'

this.$confirm({
  title: 'Custom Confirm',
  slots: {
    icon: () => h('svg', { class: 'w-8 h-8 text-purple-600', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', viewBox: '0 0 24 24', stroke: 'currentColor' }, [
      h('path', { 'stroke-linecap': 'round', 'stroke-linejoin': 'round', 'stroke-width': '2', d: 'M12 4v16m8-8H4' }),
    ]),
    message: () => h('p', { class: 'text-purple-800' }, 'This is a fully custom message with <strong>HTML</strong>.'),
    extra: () => h('div', { class: 'mt-2 text-sm text-gray-500' }, 'Extra warning or info can go here.'),
    footer: () => h('div', { class: 'flex justify-between' }, [
      h('button', { class: 'btn border-gray-300', onClick: () => /* cancel logic */ {} }, 'No, go back'),
      h('button', { class: 'btn btn-primary', onClick: () => /* confirm logic */ {} }, 'Yes, proceed'),
    ]),
  }
})

Props Summary

| Prop | Type | Default | Description | |--------------|---------|-------------|------------------------------------| | title | String | 'Confirm' | Dialog title | | message | String | 'Are you sure?' | Main confirmation message | | confirmText| String | 'OK' | Confirm button label | | cancelText | String | 'Cancel' | Cancel button label | | icon | String | 'info' | Icon type: 'info', 'success', 'warning', 'error' |

License

MIT © Ahamed Riham