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 🙏

© 2024 – Pkg Stats / Ryan Hefner

siiimple-toast

v3.1.7

Published

Toast message inspired by material design

Downloads

87

Readme

siiimple-toast

Toast message inspired by material design

npm version available license

demo

siiimple-toast is a Pure Javascript library for non-blocking notifications.

Demo

https://eunseok.me/siiimple-toast/

Installation

npm

$ yarn add siiimple-toast

cdn

<!-- import css -->
<link href="https://cdn.jsdelivr.net/npm/siiimple-toast/dist/style.css" rel="stylesheet">
<!-- import js -->
<script src="https://cdn.jsdelivr.net/npm/siiimple-toast/dist/siiimple-toast.min.js"></script>

Getting started

npm

import toast from 'siiimple-toast';
import 'siiimple-toast/dist/style.css';// style required

toast.message('Hello world');

cdn

<script>
  siiimpleToast.message('Hello world');
  // window.siiimpleToast === siiimpleToast
</script>

if you want to customize style, see style.css or style.scss

Onther examples

// success message
toast.success('Successfully processed');

// alert message
toast.alert('Something seems to be wrong');

// support HTML
toast.message('<button>Support HTML</button>'); 

// message with options
toast.message('Set options', { delay: 1000 });

// support chaining
toast
  .message('support')
  .success('chaining', { delay: 1000 });

Options

Use .setOptions() to set options

toast = toast.setOptions({
  container: 'body',
  class: 'siiimpleToast',
  position: 'top|center',
  margin: 15,
  delay: 0,
  duration: 3000,
  style: {},
});
  • container (string): selector for parent of toast elements (defaults to body)
    • use position: relative, overflow: hidden to prevent overflow
  • class (string): css class for toast element (defaults to siiimpleToast)
  • position (string): positioning toast element (defaults to top|center)
    • available: top|left, top|center, top|right, bottom|left, bottom|center, bottom|right
  • margin (number): margin between multiple toast (defaults to 15px)
  • delay (number): delay before showing toast element (defaults to 0ms)
  • duration (number): duration to show toast element (defaults to 3000ms)
  • style (object): styles for customize tosat element (defaults to {})

Available

IE9+, Chrome, Opera

License

This project is licensed under the MIT License