Git Product home page Git Product logo

bootstrap-4-advanced-toast's Introduction

Bootstrap Advanced Toast by Rajendra

img Toast Examples

Installation

Add the css and js file into the HTML file located as below.

css : /css/bs4Toast.css
js : /js/bs4-toast.js

Usage

bs4Toast.show( 'Toast Header', 'Toast Content', options);
bs4Toast.show('Toast with Button', 'This is toast with buttons example.', 
  {
    delay : 2000,
    headerClasses : [],
    bodyClasses : [],
    buttons: [
    {
      text : 'Button 1',
      class : 'btn btn-success btn-sm mr-2',
      callback : () => {
        alert('Button 1 clicked');
      }
    },
    {
      text : 'Button 2',
      class : 'btn btn-primary btn-sm',
      callback : () => {
        alert('Button 2 clicked');
      }
    }
    ],  
    icon : {
      type : 'fontawesome', // image or fontawesome
      src : 'https://via.placeholder.com/150', // src for image
      class : 'fa-bell' // class for image
    }

  }

Methods

  • show : bs4Toast.show( 'Toast Header', 'Toast Content', options);
  • primary : bs4Toast.primary( 'Toast Header', 'Toast Content', options);
  • error : bs4Toast.error( 'Toast Header', 'Toast Content', options);
  • warning : bs4Toast.warning( 'Toast Header', 'Toast Content', options);

options object should follow the key and value.

Params Key DataType
delay Default : 2 secs, Fade out in Milli Seconds in int
headerClasses Array, if you want to add some custom classes in header DOM.
bodyClasses Array, if you want to add some custom classes in body DOM.
buttons Array Object, each object should have text, class and callback method.
icon Object, inside object thier should type with value image or fontawesone, if type is image then image url should be given in src key and for fontawesome class should be given.

bootstrap-4-advanced-toast's People

Contributors

tonraj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.