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

confirm-extended-dialog

v1.0.6

Published

Confirm dialog is a web component that displays a dialog box with a message and two buttons, OK and Cancel. In adition it can be used to execute actions when the user clicks on the buttons by adding event listeners.

Downloads

11

Readme

Confirm Extended Dialog

Description

Confirm extended dialog is a web component that displays a dialog box that can be customized in the description to display buttons of Confirm and Cancel. Finally, the dialog can execute actions after clicking the Confirm or Cancel button.

Installation

Download from npm:

npm i confirm-extended-dialog

Usage

Add in the project

Once it is installed, import it in the HTML file using the script tag.

<script type="module">
    import "confirm-extended-dialog";
</script>

Title and description

To set the title and description, use the slot attribute in the HTML. For the title, use slot="title" and for description, use slot="description". You can use one or the other or both.

<confirm-extended-dialog>
    <h1 slot="title">Do you want to continue?</h1>
    <p slot="description">The changes cannot be undone.</p>
</confirm-extended-dialog>

Attributes

The confirm-extended-dialog web component has the following attributes:

  1. confirm-label. Customizes the text of the confirmation button. By default, it is Confirm.
  2. cancel-label. Customizes the text of the cancel button. By default, it is Cancel.
  3. icon. Customizes the icon to show what kind of confirmation dialog it is. The allowable values are success, warning, and error. By default, there is no icon.
  4. open. It allows opening the dialog using the attribute by setting open="true". By default, the dialog is closed.

Customize the text of the labels and the icon

<confirm-extended-dialog confirm-label="Yes" cancel-label="No" icon="warning">
    <h1 slot="title">Do you want to continue?</h1>
    <p slot="description">The changes cannot be undone.</p>
</confirm-extended-dialog>

Open immediately

<confirm-extended-dialog open="true">
    <h1 slot="title">Do you want to continue?</h1>
    <p slot="description">The changes cannot be undone.</p>
</confirm-extended-dialog>

Listeners

The confirm extended dialog web component can execute an action when the confirm or cancel button is clicked. Let's see each case:

// When the confirm button is clicked, an alert message is shown
const dialog = document.querySelector("confirm-extended-dialog");
dialog.addEventListener("confirm", () => alert("Hello world!!"));
// When the cancel button is clicked, the dialog is immediately closed and an alert message is shown.
const dialog = document.querySelector("confirm-extended-dialog");
dialog.addEventListener("cancel", () => alert("Goodbye world!!"));

Technologies

Contributing

Any contribution is welcome.

License

MIT licensed.