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

dile-modal

v1.5.4

Published

Web Component to implement a modal box

Readme

Moved

This package has moved and is now available at @dile/dile-modal. Please update your dependencies. This repository is no longer maintained.

dile-modal

This is a Web Component to implement a modal box, based on LitElement.

Go to demos page

Use

Install it from npm:

npm i dile-modal

Place the script In your HTML page or include the dile-modal.js file in your JS bundle. After that you can use the dile-modal tag, like this:

<dile-modal id="myModal">
  <p>
    Lorem, ipsum dolor sit...
  </p>
</dile-modal> 

Whatever you place inside the <dile-modal> tag will be the content displayed when the modal box opens.

When needed, you may use the open() method to open the modal box interface, and close() to close it.

document.getElementById("myModal").open();

Other posibility in order to open or close the modal box is to set the boolean opened attribute.

Properties

  • opened: Bolean property used to change the modal state, false is closed / true means open.
  • showCloseIcon: Boolean property to tell the modal box you want a close icon to be displayed.
  • blocking: Boolean property to configure the modal box as a bloking interface. If true the modal box blocks the screen. That is, when you click in the background layer, the modal box do not close.

Methods

  • open: Use it to open the modal box
  • close: Use it to close the modal box

Events

  • dile-modal-closed: Dispatched when the modal box becomes closed, in case you are called the close() method, or clicked in the background modal, or by the close icon.
  • dile-modal-background-closed: Dispatched when the modal box is closed because the user clicks in the background layer.

Style customization

You can customize the modal box interface by using the CSS custom properties bellow.

Custom property | Description | Default ----------------|-------------|--------- --dile-modal-background-color | Modal layer background color | rgba(30,30,30, 0.8) --dile-modal-z-index | Modal layer z-index | 100 --dile-modal-content-z-index | Content layer z-index | 101 --dile-modal-width | Content layer width | 280px --dile-modal-min-width | Content layer min width | 250px --dile-modal-max-width | Content layer max width | 100vw --dile-modal-height | Conten layer height | auto --dile-modal-min-height | Content layer max height | auto --dile-modal-max-height | Content layer max height | 100vh --dile-modal-content-background-color | Content layer background color | #fff --dile-modal-content-padding | Content layer padding | 1em --dile-modal-border-radius | Content layer border radius | 15px --dile-modal-content-shadow-displacement | content layer shadow offset | 6px --dile-modal-content-shadow-blur | Content layer shadow blur | 16px --dile-modal-content-shadow-color | Content layer shadow color | #000 --dile-modal-close-icon-color | Close icon color | #888 --dile-modal-close-icon-size | Close icon size | 24px --dile-modal-animation-duration | Duration of the opacity modal animation | 0.3s --dile-modal-close-icon-top | Top position applied to the close icon | 5px --dile-modal-close-icon-right | Right position applied to the close icon | 18px