# bootstrap-toast

> Simple toast library for Angular 2+ with Bootstrap 4. See [this demo](https://bootstrap-toast-example.web.app/) and try options.

Latest version **1.0.13** (published 2020-01-08) · 0 weekly downloads

## Install

```sh
npm install bootstrap-toast
pnpm add bootstrap-toast
yarn add bootstrap-toast
bun add bootstrap-toast
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2020-01-08 |
| First published | 2019-12-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 276.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | godanydev |
| Keywords | bootstrap, angular, toast |

## Links

- npm: https://www.npmjs.com/package/bootstrap-toast
- npm.io page: https://npm.io/package/bootstrap-toast

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.13 (latest) — 2020-01-08
- 1.0.12 — 2019-12-27
- 0.0.11 — 2019-12-26
- 0.0.10 — 2019-12-25
- 0.0.9 — 2019-12-25
- 0.0.8 — 2019-12-25
- 0.0.7 — 2019-12-25
- 0.0.6 — 2019-12-24
- 0.0.5 — 2019-12-22
- 0.0.4 — 2019-12-22
- 0.0.3 — 2019-12-22
- 0.0.2 — 2019-12-22
- 0.0.1 — 2019-12-22

## README

# BootstrapToast for Angular 2+

Simple toast library for Angular 2+ with Bootstrap 4. See [this demo](https://bootstrap-toast-example.web.app/) and try options.

## Requirements

Must be install the following npm packages:

1. bootstrap

## Installation

`npm install --save bootstrap-toast`

Import `bootstrap-toast` module your ngModule.
Paste the following code the end of the app.component.html file:

```html
<lib-bootstrap-toast [config]="config"></lib-bootstrap-toast>
```

The config parameter is optional but if you want to modify default config, you use the following format: 
```json
{
  "position": "top-right", // or top-left, bottom-left, bottom-right
  "autoclose": true, // true or false
  "delay": 3 // seconds
}
```

The following example shows how to create a toast notification programatically. The function returns Subject instance. If the notification has one or more buttons, you can subscribe this instance to catch button actions.

```typescript
this.toast.create( {
  "title": "Message",
  "message": "This is Sparta!",
  "buttons": [
    {
      "label": "OK",
      "action": "ok",
      "class": "btn-primary"
    },
    {
      "label": "Cancel",
      "action": "cancel",
      "class": "btn-light"
    }
  ]
} ).subscribe(action => { ... })
```

Thats all.

---
_Source: https://npm.io/package/bootstrap-toast · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
