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

dtoaster

v0.1.4

Published

DToaster

Downloads

160

Readme

DToaster

- Basic and viable toasts with progressbar and high customizabillity

DEMO

Alt Text Alt Text

Requisites

VueJS >= 2.x

Install

$ npm i dtoaster

Usage

You can import and use the module everywhere in your app using:

app.js:

import 'dtoaster/dist/dtoaster.css'
import DToaster from 'dtoaster'
import ToasterPresets from './json/toast_presets.json' //Your predefined toasts presets (optionally)

Vue.use(DToaster, {
  presets: ToasterPresets,
  position: 'top-right', //toasts container position on the screen
  containerOffset: '45px', //toasts container offset from top/bottom of the screen
})

anycomponent.vue:

this.$dtoast.pop({
  preset: "your_preset",
  heading: `Custom Heading`,
  content:  `Custom content`,
  {...}
})

Predefined toasts (presets)

You can create a json file with array of objects which are predefined toasts with all your options you want. Every preset must be associated with a name, which is used in loading the particular preset in a toast

Example of a json file:

[
    {
        "name" : "success",
        "icon" : "mdi mdi-checkbox-multiple-marked-circle-outline",
        "icon_size" : "32px",
        "duration" : "2500",
        "background" : "rgba(32,105,156,.9)",
        "height" : "75px",
        "color" : "#FFFFFF",
        "show_progress_timeout" : "true",
        "progress_background" : "#5a9fdc",
        "progress_thumb_bg" : "rgba(32,105,156,.9)"
    },

    {
        "name" : "error",
        "icon" : "mdi mdi-close-circle-outline",
        "icon_size" : "32px",
        "duration" : "2500",
        "background" : "#ff1e1e",
        "height" : "75px",
        "color" : "#FFFFFF",
        "show_progress_timeout" : "true",
        "progress_background" : "rgb(255 175 175)",
        "progress_thumb_bg" : "#ff1e1e"
    }
]

You can then use a specific preset by providing its name when 'popping' a toast:

  this.$dtoast.pop({
    preset: "success",
    {...}
  })

This will create a toast with the options from your desired preset, which eliminate the need of re-typing every option every time you pop the same toast

You can override specific preset option for a toast, leaving others unchanged

  this.$dtoast.pop({
    preset: "success",
    color: "red",
    heading: "Toast with a different heading",
    content: "Toast with a different content",
    {...}
  })

Toast Options

| Option | Type | Function | Default | Available | | :--- | :---: | :--- | :--- | :---: |
| toastVerticalOffset | String | Vertical offset of each toast | 5px | null, -- | | position | String | Position of the toast container | top-right | top-right, top-left, bottom-right, bottom-left | | width | String | Toast's width | 300px | -- | | height | String | Toast's height | 75px | -- | | name | String | Used preset name | -- | null, -- | | heading | String | Toast's heading | -- | -- | | content | String | Toast's content | -- | -- | | icon | String | Toast's icon class | -- | -- | | icon_size | String | Toast's icon font-size | 23px | -- | | transition | String | Toast's transitioning | slide | slide, more to come | | duration | String | Toast's duration | 1000 | -- | | background | String | Toast's background color | black | -- | | color | String | Toast's font color | white | -- | | show_progress_timeout | String | Show the progressbar | true | -- | | progress_background | String | Progressbar's background color | tomato | -- | | progress_thumb_bg | String | Progressbar's thumb color | red | -- | | _style | String | Any style to override on the toast | -- | {prop: value, ...} |

Container Options

| Option | Type | Function | Default | Available | | :--- | :---: | :--- | :--- | :---: |
| containerVerticalOffset | String | Vertical offset of the container | 35px | null, -- | | containerSideOffset | String | Side offset of the container | 5px | null, -- |

If you feel the need to thank me

BTC - bc1q8zhwxa5l6zg3amxten5rmetdkrz4sp78qzl5c4

ETH - 0x5e251964ACD0765694Bff190D88a6a727D986912