Skip to content

onechiporenko/ember-bootstrap-toasts-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ember-bootstrap-toasts-manager

CI Ember Observer Score npm version License Downloads

ember-bootstrap-toasts-manager is an Ember-addon that provides a simple mechanism for interaction with user using toasts. This addon is based on ember-bootstrap.

Installation

ember i ember-bootstrap-toasts-manager

Add next to your application.hbs:

<ToastsContainer />
import Controller from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import ToastsManager from "ember-bootstrap-toasts-manager/services/toasts-manager";

export default class ApplicationController extends Controller {
  @service declare toastsManager: ToastsManager;

  @action
  showToast() {
    this.toastsManager.showBaseToast({
      title: "Hello",
      message: "This is a toast message",
    });
  }
}

Custom components could be used as well:

this.toastsManager.showToast(CustomToastComponent, {
  title: "Hello",
  message: "This is a toast message",
});

Here CustomToastComponent is a component that will be used to render a toast.

Check components/toasts/base for an example of toast component. Also check Bootstrap Toasts #Custom Content docs.

Compatibility

  • ember-bootstrap@6
  • bootstrap@5

Demo

Check demo-page

About

Ember-addon that provides a simple mechanism for interaction with user using toasts.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •