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

uni-toasts

v1.0.3

Published

<uni-toasts /> is a robust Web Component built on the foundation of the uniopen design language. Its primary capability is delivering seamless message notifications across applications. By utilizing the provided attributes and properties, developers can f

Readme

uni-toast

Published on webcomponents.org DeepScan grade

<uni-toasts /> is a robust Web Component built on the foundation of the uniopen design language. Its primary capability is delivering seamless message notifications across applications.

By utilizing the provided attributes and properties, developers can finely tune the rendering and behavior of individual toasts to match specific UI requirements. Furthermore, the component natively supports multi-toast stacking, offering a sophisticated presentation layer that elevates the overall messaging experience into something diverse and engaging.

<uni-toasts />

Basic Usage

<uni-toasts /> is a web component. All we need to do is put the required script into your HTML document. Then follow <uni-toasts />'s html structure and everything will be all set.

  • Required Script

    <script
      type="module"
      src="https://unpkg.com/uni-toasts/mjs/wc-uni-toasts.js">        
    </script>
  • Structure

    Put <uni-tab-group /> into HTML document. It will have different functions and looks with attribute mutation.

    <uni-toasts
      maxcount="3"
      autodismiss
    ></uni-toasts>

JavaScript Instantiation

<uni-toasts /> could also use JavaScript to create DOM element. Here comes some examples.

<script type="module">
import { UniToasts } from 'https://unpkg.com/uni-toasts/mjs/wc-uni-toasts.js';

// use DOM api
const nodeA = document.createElement('uni-toasts');
document.body.appendChild(nodeA);
nodeA.maxcount = 3;

// new instance with Class
const nodeB = new UniToasts();
document.body.appendChild(nodeB);
nodeB.maxcount = 3;

// new instance with Class & default config
const config = {
  maxcount: 3,
  autodismiss: true
};
const nodeC = new UniToasts(config);
document.body.appendChild(nodeC);
</script>

Style Customization

Developers could apply styles to decorate <uni-toasts />'s looking.

<style>
uni-toasts {
  --uni-toasts-axis-y: 76px;
}
</style>

Attributes

<uni-toasts /> component exposes a curated set of attributes, enabling developers to dynamically adjust the user interface. This provides the flexibility to tailor the component’s appearance to seamlessly adapt to any given context.

  • maxcount

    The maxcount attribute defines the maximum number of toast notifications allowed to be displayed simultaneously on the screen. When the number of active toasts exceeds this specified limit, the oldest notification will be automatically dismissed to make room for the new one. This attribute enforces a strict validation range, accepting integer values from a minimum of 2 to a maximum of 20. If an invalid value is supplied or omitted, the component defaults to 3.

    <uni-toasts
      maxcount="3"
    >
    </uni-toasts>
  • autodismiss

    The autodismiss attribute determines whether toast notifications are automatically cleared after a specific duration. Each notification carries a predefined lifespan based on its content type: standard messages persist for 3 seconds, while notifications containing an action button extend their visibility to 6 seconds to allow for user interaction. Enforcing this attribute activates the automatic cleanup mechanism. By default, this feature is disabled.

    <uni-toasts
      autodismiss
    >
    </uni-toasts>

Properties

| Property Name | Type | Description | | ----------- | ----------- | ----------- | | maxcount | Integer | Getter / Setter maxcount. maxcount defines the maximum number of toast notifications allowed to be displayed simultaneously on the screen. When the number of active toasts exceeds this specified limit, the oldest notification will be automatically dismissed to make room for the new one. This attribute enforces a strict validation range, accepting integer values from a minimum of 2 to a maximum of 20. If an invalid value is supplied or omitted, the component defaults to 3. | | autodismiss | Boolean | Getter / Setter autodismiss. autodismiss attribute determines whether toast notifications are automatically cleared after a specific duration. Each notification carries a predefined lifespan based on its content type: standard messages persist for 3 seconds, while notifications containing an action button extend their visibility to 6 seconds to allow for user interaction. Enforcing this attribute activates the automatic cleanup mechanism. By default, this value is false. |

Method

| Mathod Signature | Description | | ----------- | ----------- | | show(content = '', option = {}) | The show method is the primary programmatic interface for dispatching notifications. To trigger a message, simply pass the desired string to the content parameter. Advanced behaviors and styles can be further configured through the optional option object. The option parameter currently supports three properties: stat, action, and params. These properties allow developers to alter the visual state of the toast, render an interactive action button, and define the custom parameters to be passed back to the accompanying callback function. |

Here comes the example.

<script type="module">
const uniToasts = document.querySelector('uni-toasts');

uniToasts.show(
  'Show me the money',
  {
    stat: 'valid', // (String). Typically accepts state tokens such as 'valid' or 'invalid'
    action: 'action', // (String). The label text for the interactive action button. If omitted, no button will be rendered.
    params: {
      url: 'https://tw.bid.yahoo.com'
    } // (Object). A payload containing custom data properties to be passed back when the action button's event or callback is captured.
  }
);
</script>

Reference