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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@componentt/toast

v1.0.3

Published

Agnostic toast component

Downloads

720

Readme

Componentt-toast

This is a very simple and easy library for using toast in your application.

componentt-toast is created using Stencil

This library is inspired in a codepen post

Styles

componentt-toast have a two themes and two positions

Light - top Light top

Light - bottom Light Bottom

dark - top Dark top

dark - bottom Dark Bottom

Usage


<script type="module">
  import {Toast} from '/build/index.esm.js'

  const toast = new Toast({
    theme: 'light', // or dark
    placement: 'bottom' // or top
  })

  //create a element for put in action section   
  const button = document.createElement('button')
  button.innerHTML = 'ok, this slot works fine'
  button.addEventListener('click', () => console.log('I will clicked'))

  toast.emit({
    type: 'success', title: 'Lorem Ipsum is simply', progress: true, cooldown: 100000, description: `
    0 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
    standard dummy text ever since the 1500s, when an unknown printer took a galley of
    type and scrambled it to make a type specimen book.Lorem Ipsum is simply dummy text
    of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dumm
    text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to
    make a type specimen book.Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
    took a galley of type and scrambled it to make a type specimen book.Lorem Ipsum is simply dummy text of
    the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since
    the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  `, actions: [button]
  })
  toast.emit({
    type: 'error', title: 'Lorem Ipsum is simply', progress: false, cooldown: 100000, actions: [button]
  })
  toast.emit({
    type: 'info', title: 'Lorem Ipsum is simply', progress: false, cooldown: 100000
  })
  toast.emit({
    type: 'warning', title: 'Lorem Ipsum is simply', progress: false, cooldown: 100000, actions: [button]
  })
  toast.emit({
    type: 'warning', title: 'Title Prop', progress: false, cooldown: 100000
  })
</script>

Creating a custom theme;

[data-theme~='dark'] {
  .ctt-toast {
    &__item {
      background: #222222;
    }

    &__title,
    &__close > button,
    &__description,
    &__viewMoreOrLessButton button{
      color: #f0f0f0;
    }
  }

  ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 100px rgba(36, 37, 42, 0.9);
    border-radius: 5px;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 5px;
    -webkit-box-shadow: inset 0 0 100px rgba(136, 136, 143, 1);
  }
}

Custom placement

[data-placement~='top'] {
  top: 0;

  flex-direction: column-reverse;

  .ctt-toast {

    &__item:not(:last-child) {
      margin-top: 8px;
    }

    &__item:nth-child(n + 4) {
      top: 0;
      margin-top: 8px;
    }

    &__item:nth-child(n + 6) {
      opacity: 0;
    }

    &__item:nth-child(4) {
      opacity: 0.95;
      transform: translateY(-7px) scale(0.98);
      z-index: 1990;
    }

    &__item:nth-child(5) {
      opacity: 0.9;
      transform: translateY(-13px) scale(0.95);
      z-index: 1980;
    }

  }
}

Icon

Yours custom icon

  toast.emit({
    type: 'error', title: 'Lorem Ipsum is simply', icon:"fa fa-alert", progress: false, cooldown: 100000, actions: [button]
  })

#Example https://codepen.io/Rafaelgfirmino/pen/yLJRVPa