🥖 A Simple and Flexible Stacking Toast Style Notifications In Vue.js

Breadstick is a simple and flexible implementation of toast-style notifications for Vue.js. Inspired by React’s toasted notes – which I think are really cool.

react toast notification, react notification component, react toast notification example, how to use react toastify, react toastify promise example

Features

  • Functional stacking, positioning, timing, and separation API. Breadstick reveals functionality that allows you to control stacking, positioning, and dismiss toast style notifications.
  • Submit what you want. Take advantage of the show’s callback to create beautiful custom notifications.
  • Functional default patterns. Import the CSS provided for some great design defaults or write your own styles.
  • Vue framework neutral notification. Breadstick has no say in the design of Vue’s roasted notifications. Its main strengths lie in handling the business logic of stacking, positioning, timing, and dismissing your toast notifications.

How to make use of it:

Install and download:

# Yarn
$ yarn add breadstick

# NPM
$ npm install breadstick --save

1. Install and register the Vue Breadstick component.

import Vue from 'vue'
import Breadstick from 'breadstick'

Vue.use(Breadstick)
// or
const breadstick = new Breadstick()

2. Create a basic toast message using the notification method.

this.$breadstick.notify('Toast Message Here');

3. It also works with JSX and Vue.js render functionality.

import Alert from './components/Alert'

export default {
  name: 'app',
  mounted () {
    const showAlert = () => alert('Hello!')
    breadstick.notify(({ onClose }) => {
      return (
        
          An JSX Alert notification
        
      )
  }
}
import Alert from './components/Alert'

export default {
  name: 'app',
  mounted () {
    this.$breadstick.notify(({ h, onClose }) => {
      return h(Alert, {
        on: {
          click: onClose
        }
      }, 'A render function Alert notification')
    })
  }
}

4. Change the position of the toast message. Available positions: ‘up’, ‘down’, ‘top left’, ‘top right’, ‘bottom left’, ‘bottom right’.

const breadstick = new Breadstick({
      position: 'bottom'
})

5. Change the waiting time before the automatic rejection of the toast message.

const breadstick = new Breadstick({
      duration: 6000
})

Options

OptionTypeDefaultValues
positionStringtoptoprightbottomlefttop-lefttop-rightbottom-rightbottom-left
durationNumber5000Any number in milliseconds

Simple Flexible Toast Notification Component, Breadstick Plugin/Github


See Demo And Download

Official Website(codebender828): Click Here

This superior jQuery/javascript plugin is developed by codebender828. For extra advanced usage, please go to the official website.

Related Posts

svg-pan-zoom-container

Adding Zoom-on-Wheel and Pan-on-Drag to Inline SVG Elements

Vanilla-js module for adding zoom and panning behavior when dragging to SVG embedded elements. A lightweight Vanilla JavaScript plugin that enables zoom and pan functions on an…

html-table-sortable-js

Sorting HTML Table Vanilla JavaScript Library | Sortable.js

Sortable – Small JS vanilla table sorter makes any table with class = “sortable“, er, sortable. That is, the user can click the table header and change…

WYSIWYG-Rich-Text-Editor

WYSIWYG Rich Text Editor With jQuery And FontAwesome | RichText

RichText jQuery implementation for WYSIWYG Rich Text Editor which uses Font Awesome Iconic Font for editor icons. It is licensed under AGPL-3.0. Initialize editor Simply call .richText() on your jQuery(‘textarea’) or jQuery(‘input’)…

email-domain-autocomplete-genie

[Autocomplete] Email Domain Suggestions Like Gmail, Outlook, or More | email-genie

Email Genie allows auto-completion in the email field by providing a list of domain suggestions (gmail.com, outlook.com, etc.). This package is lightweight, flexible, compatible with libraries (jQuery,…

JavaScript-Library-for-Creating-Squircley-Magic

[Generator] JavaScript Library for Creating Squircley Magic ✨ | squircley.js

squircley.js is the core magic of Squirclular ✨ from https://squircley.app wrapped in a simple 0-dependency JavaScript library. squircley.js can generate SVG files, add square backgrounds to DOM…