JavaScript class representing a snackbar dialog
npm install makeup-snackbar-dialogJavaScript class representing a snackbar dialog. No CSS provided.
The following markup structure and classnames are required. Any SVG icons can be used.
``html`
class="snackbar-dialog snackbar-dialog--transition"
role="dialog"
aria-label="Notification"
aria-live="polite"
aria-modal="false"
hidden
>
No CSS is provided. However, the class is fully compatible with eBay Skin.
`js
import SnackbarDialog from "makeup-snackbar-dialog";
document.querySelectorAll(".snackbar-dialog").forEach(function (el, i) {
const widget = new SnackbarDialog(el, config);
});
``
The constructor takes a configuration object as its second parameter.
todo
Fired when the dialog is opened.
Fired when the dialog is closed.