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

@aircss/svelte-modal

v2.0.3

Published

A simple modal dialog based on aircss and svelte.

Readme

Modal dialog

svelte-modal is a simple modal dialog based on aircss and svelte.

Installation

In an existing svelte project, simply run the following command:

npm add @aircss/svelte-modal

Usage

The following example is a page with a basic "two-buttons" confirmation dialog and a clickable button to show it:

<script lang="ts">
	import '@aircss/air';

	import Modal from '@aircss/svelte-modal';

	let modal;
</script>

<Modal bind:this={modal} class="w6 ba bg--white" on:success={console.log} on:cancel={console.warn}>
	<h2 class="ma0 pa4 bb b--noir-20">Confirm</h2>

	<div class="ph4">
		<p class="lh-body tj i">Do you confirm the pending operation ?</p>
	</div>

	<div class="flex pa4 bt b--noir-20 evenly-filled">
		<button class="w4 pa3 ba bg--red white pointer tc" on:click={modal.close}> No </button>

		<button
			class="w4 pa3 ba bg--emeraude white pointer tc"
			data-success="true"
			on:click={modal.close}
		>
			Yes
		</button>
	</div>
</Modal>

<button on:click={modal.show}>Show</button>

Props

  • id: set a id attribute to the model element (optional)
  • class: set custom classes for the modal element (optional)
  • params: bi-directional binding to share anything between caller and callee (optional)

Methods

  • show(payload: unknown): make the modal visible and set its params prop with the passed argument. If the method is called by an HTML event (like a click on a button element), show() will use the data attributes of the event target if there is any.

  • close(payload: unknown): make the modal disappear. The custom event triggered by closing the modal will use the payload as its detail. If the method is called by an HTML event (like a click on a button element), close() will use the data attributes of the event target if there is any.

Events

  • show: this event is fired anytime the modal is made visible. event.detail holds the params argument of the ad-hoc method if set.

  • close: this event is fired anytime the modal disappears. event.detail holds the payload of the ad-hoc method if set (through method args or data attributes of the event target).

  • success: this event is fired when the modal disappears and if the close() method has a payload (through method args or data attributes of the event target).

  • cancel: this event is fired when the modal disappears and if the close() method has no payload (through method args or data attributes of the event target).