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

@duskmoon-dev/el-dialog

v1.5.5

Published

A modal dialog component built with Web Components.

Downloads

1,224

Readme

@duskmoon-dev/el-dialog

A modal dialog component built with Web Components.

Installation

bun add @duskmoon-dev/el-dialog

Usage

Auto-Register

import '@duskmoon-dev/el-dialog/register';
<el-dm-dialog id="myDialog">
  <span slot="header">Dialog Title</span>
  <p>Dialog content goes here.</p>
  <div slot="footer">
    <el-dm-button variant="ghost">Cancel</el-dm-button>
    <el-dm-button variant="primary">Confirm</el-dm-button>
  </div>
</el-dm-dialog>

Manual Registration

import { ElDmDialog, register } from '@duskmoon-dev/el-dialog';

// Register with default tag name
register();

// Or register with custom tag name
customElements.define('my-dialog', ElDmDialog);

Sizes

| Size | Description | |------|-------------| | sm | Small dialog | | md | Medium dialog (default) | | lg | Large dialog | | full | Full-screen dialog |

Attributes

| Attribute | Type | Default | Description | |-----------|------|---------|-------------| | open | boolean | false | Whether the dialog is open | | size | string | 'md' | Size: sm, md, lg, full | | dismissible | boolean | true | Allow closing via backdrop/escape | | no-backdrop | boolean | false | Hide the backdrop |

Slots

| Slot | Description | |------|-------------| | (default) | Dialog body content | | header | Dialog header/title | | footer | Dialog footer with actions |

CSS Parts

| Part | Description | |------|-------------| | dialog | The dialog element | | backdrop | The backdrop overlay | | content | The content wrapper | | header | The header section | | body | The body section | | footer | The footer section | | close | The close button |

Events

| Event | Detail | Description | |-------|--------|-------------| | open | - | Fired when dialog opens | | close | - | Fired when dialog closes |

Examples

Basic Dialog

<el-dm-button onclick="document.querySelector('#dialog').open = true">
  Open Dialog
</el-dm-button>

<el-dm-dialog id="dialog">
  <span slot="header">Confirmation</span>
  <p>Are you sure you want to proceed?</p>
  <div slot="footer">
    <el-dm-button variant="ghost" onclick="this.closest('el-dm-dialog').open = false">
      Cancel
    </el-dm-button>
    <el-dm-button variant="primary">
      Confirm
    </el-dm-button>
  </div>
</el-dm-dialog>

Sizes

<el-dm-dialog size="sm">Small dialog</el-dm-dialog>
<el-dm-dialog size="md">Medium dialog</el-dm-dialog>
<el-dm-dialog size="lg">Large dialog</el-dm-dialog>
<el-dm-dialog size="full">Full-screen dialog</el-dm-dialog>

Non-Dismissible

<el-dm-dialog dismissible="false">
  <span slot="header">Required Action</span>
  <p>You must complete this action.</p>
  <div slot="footer">
    <el-dm-button variant="primary">Continue</el-dm-button>
  </div>
</el-dm-dialog>

Programmatic Control

const dialog = document.querySelector('el-dm-dialog');

// Open
dialog.open = true;

// Close
dialog.open = false;

// Listen for events
dialog.addEventListener('close', () => {
  console.log('Dialog closed');
});

License

MIT