Socket
Socket
Sign inDemoInstall

bs4-toast

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bs4-toast

Toast - A Bootstrap 4.2+ jQuery plugin for the toast component


Version published
Weekly downloads
769
increased by6.07%
Maintainers
1
Install size
10.4 MB
Created
Weekly downloads
 

Readme

Source

Toast - A Bootstrap 4.2+ jQuery plugin

  • About
  • Usage
  • Contributing

About

As of Bootstrap 4.2, toasts have been introduced and the aim of this plugin is to make them easier to use.

Usage

Gloabls

Modify the global variables to apply specific rules/styles to all your toasts.

$.toastDefaults = {
    position: 'top-right', /** top-left/top-right/top-center/bottom-left/bottom-right/bottom-center - Where the toast will show up **/
    dismissible: true, /** true/false - If you want to show the button to dismiss the toast manually **/
    stackable: true, /** true/false - If you want the toasts to be stackable **/
    pauseDelayOnHover: true, /** true/false - If you want to pause the delay of toast when hovering over the toast **/
    style: {
        toast: '', /** Classes you want to apply separated my a space to each created toast element (.toast) **/
        info: '', /** Classes you want to apply separated my a space to modify the "info" type style  **/
        success: '', /** Classes you want to apply separated my a space to modify the "success" type style  **/
        warning: '', /** Classes you want to apply separated my a space to modify the "warning" type style  **/
        error: '', /** Classes you want to apply separated my a space to modify the "error" type style  **/
    }
};
Snack

A "snack" is a bitesized "toast".

$.snack(type, title, delay)

Note: The final argument delay is omitable. If omitted, the toast will remain forever.

Toast
$.toast({
    type: 'info',
    title: 'Notice!',
    subtitle: '11 mins ago',
    content: 'Hello, world! This is a toast message.',
    delay: 5000,
    img: {
        src: 'https://via.placeholder.com/20',
        class: 'rounded-0', /**  Classes you want to apply separated my a space to modify the image **/
        alt: 'Image'
    }
});

Contributing

Feel free to contribute in any of the ways outlined:

  • Submit issues/pull requests
  • Tell us how you're using this plugin in your project

Keywords

FAQs

Last updated on 25 Nov 2020

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