Skip to content

Coolbrains toast notification web component - Built With Stenciljs

Notifications You must be signed in to change notification settings

nazmulpro/cb-toast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

cb-toast

Coolbrains Toast Notification web component - Built With Stenciljs

Toast

This is a toast notification Web Component using Stenciljs.

  • Built with Stencil
  • Built with TailwindCSS v3.x

Demo

Demo

Installation

npm install cb-toast

Or use npm cdn

<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cb-toast/cb-toast.esm.js"></script>

Usage

The Coolbrains toast Component can be use as following:

<cb-toast></cb-toast>

<button id="showToastSuccess" class="bg-green-700">Success</button>
<script>

let cbToast = document.querySelector('cb-toast');

document.getElementById('showToastSuccess').addEventListener('click', event => {

        cbToast.Toast({
          title: 'Success', //default
          description: 'success message', //default
          timeOut: 3000, //default
          position: 'top-right', //default
          type: 'success', //default
        });

      });

</script>

Positions

'top';
'bottom';
'top-left';
'top-right'; //default
'bottom-left';
'bottom-right';

type

'success'; //default
'info';
'warning';
'error';

About

Coolbrains toast notification web component - Built With Stenciljs

Resources

Stars

Watchers

Forks

Packages

No packages published