1.0.4 • Published 5 months ago

@nite1984/nite-bs-toast v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

nite-bs-toasts

Install

npm i @nite1984/nite-bs-toast
import niteBsToast from '@nite1984/nite-bs-toast';

window.niteBsToast = niteBsToast;

Usage

//Define a container for the toasts in your html template
<div class="toast-container"></div>

niteBsToast.successToast('ok', 'msg');
niteBsToast.errorToast('ok', 'msg');
niteBsToast.laravelErrorToast('error', laravelResponseErrorsObj);

niteBsToast.showLoadingToast('ok', 'msg');
niteBsToast.hideLoadingToast();

//In case you want to customize the selector for the toast container
niteBsToast.settings({
    toastContainerSelector: '.toast-container',
    toastHtmlTemplate: `<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
        <div class="toast-header p-0">
            <div style="border-left: 15px solid {{iconColor}};">
                <div class="p-2 d-flex align-items-center">
                    <strong>{{title}}</strong>
                    <button type="button" class="btn-close mx-0" aria-label="Close" data-bs-dismiss="toast"></button>
                </div>
            </div>    
        </div>
        <div class="toast-body bg-white">{{text}}</div>
        </div>`
});
1.0.4

5 months ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago