Socket
Socket
Sign inDemoInstall

toasters

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    toasters

Toast alerts (initially developed for Vue.js with a material-design style)


Version published
Weekly downloads
11
Maintainers
1
Install size
22.0 kB
Created
Weekly downloads
 

Readme

Source

toasters

Toast alerts/notifications (initially developed for Vue.js with a material-design style)

Installation

npm install --save --production toasters

Usage

HTML:

<div id="toasts-container" class="position-right position-bottom">
  <div id="toasts-content">
    <!-- toasts will be added or removed from here -->
  </div>
</div>

JS:

import Toast from "toasters";

// example
new Toast({
  content: "Hello World",
  interactable: false
});

// or
new Toast("Hello World");

// or
new Toast("Hello World", { persistent: true, timeout: 9000 });

Preview:

preview of visible toast on webpage

Options

OptionTypeDefaultDescription
contentString""The notification message.
persistentBooleanfalseWhether or not the toast is persistent.
interactableBooleantrueIf the toast can be manually closed or not.
timeoutNumber6000How long till the toast disappears. Note: will be ignored if the toast is persistent.
visibleBooleantrueIf the toast will be visible when instantiated.

Potential future additions

  • Error handling (i.e. you haven't provided any content for the toast)
  • Ability to parse markdown or html

Contributing

# install dependencies
npm install

# watch files for changes with webpack
npm run dev

# build for production with minification
npm run build

FAQs

Last updated on 16 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc