Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onechiporenko/ember-bootstrap-toasts-manager
Ember-addon that provides a simple mechanism for interaction with user using toasts.
https://github.com/onechiporenko/ember-bootstrap-toasts-manager
ember-addon ember-bootstrap emberjs toast
Last synced: about 1 month ago
JSON representation
Ember-addon that provides a simple mechanism for interaction with user using toasts.
- Host: GitHub
- URL: https://github.com/onechiporenko/ember-bootstrap-toasts-manager
- Owner: onechiporenko
- License: mit
- Created: 2024-05-20T10:43:37.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-05-22T08:16:35.000Z (6 months ago)
- Last Synced: 2024-05-22T12:13:31.868Z (6 months ago)
- Topics: ember-addon, ember-bootstrap, emberjs, toast
- Language: TypeScript
- Homepage: https://onechiporenko.github.io/ember-bootstrap-toasts-manager/
- Size: 715 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-bootstrap-toasts-manager
[![CI](https://github.com/onechiporenko/ember-bootstrap-toasts-manager/actions/workflows/ci.yml/badge.svg)](https://github.com/onechiporenko/ember-bootstrap-toasts-manager/actions/workflows/ci.yml)
[![Ember Observer Score](https://emberobserver.com/badges/ember-bootstrap-toasts-manager.svg)](https://emberobserver.com/addons/ember-bootstrap-toasts-manager)
[![npm version](https://badge.fury.io/js/ember-bootstrap-toasts-manager.png)](http://badge.fury.io/js/ember-bootstrap-toasts-manager)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
[![Downloads](http://img.shields.io/npm/dm/ember-bootstrap-toasts-manager.svg)](https://www.npmjs.com/package/ember-bootstrap-toasts-manager)`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`:
```html
```
```typescript
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 toastsManager!: ToastsManager;@action
showToast() {
this.toastsManager.showBaseToast({
title: 'Hello',
message: 'This is a toast message',
});
}
}
```Custom components could be used as well:
```typescript
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](https://getbootstrap.com/docs/5.3/components/toasts/#custom-content) docs.
## Compatibility
* `ember-bootstrap@6`
* `bootstrap@5`## Demo
Check [demo-page](https://onechiporenko.github.io/ember-bootstrap-toasts-manager/#/demo)