Skip to content

Commit

Permalink
Added progress bar documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stabzs committed Dec 1, 2020
1 parent 86f9147 commit 0e6cdeb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@
* **toast:** A new `tapToDismiss?: boolean` property has been added to the toast object. This allows for
each individual toast to override the global `tapToDismiss` config.
Closes [#178](https://github.com/Stabzs/Angular2-Toaster/issues/178).
* **toast:** A progress bar has been added on a toast-by-toast basis with two progress directions:
decreasing and increasing. By default, the progress bar is disabled.
* **toaster.css:** Styles have been rebuilt around flexbox and have removed IE and webkit-specific prefixes.
This allows for more compact css and should make it easier for users to override styles. It also fixes close
button layout issues in Firefox, resolving [#192](https://github.com/Stabzs/Angular2-Toaster/issues/192).
Expand Down
20 changes: 19 additions & 1 deletion README.md
Expand Up @@ -6,7 +6,7 @@ largely based off of [AngularJS-Toaster](https://github.com/jirikavi/AngularJS-T
[![npm](https://img.shields.io/npm/v/angular2-toaster.svg?maxAge=3600?800=true)](https://www.npmjs.com/package/angular2-toaster)
[![npm](https://img.shields.io/npm/dt/angular2-toaster.svg?cache=true)](https://www.npmjs.com/package/angular2-toaster)
[![Build Status](https://travis-ci.org/Stabzs/Angular2-Toaster.svg?branch=master)](https://travis-ci.org/Stabzs/Angular2-Toaster)
[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=8.0.0)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=11.0.0)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master)

Version ^11.0.0 has a number of new features, type definitions, and break changesing. Please review the
[CHANGELOG](CHANGELOG.md/#11.0.0) for a list of features and breaking changes before upgrading.
Expand Down Expand Up @@ -555,6 +555,24 @@ of the toast.
Mutation of the toast instance is not recommended.
### Progress Bar
A progress bar can be enabled per toast via the `progressBar` property. If set to true, a progress bar will be
displayed that indicates how much time is remaining for the toast before it is automatically dismissed.
The progress bar has two directions: `decreasing` or right-to-left and `increasing`, or left-to-right. While defaulted
to `decreasing`, it can be overridden per toast:
```typescript
var toast: Toast = {
type: 'success',
progressBar: true,
progressBarDirection: 'increasing'
};

this.toasterService.pop(toast);
```
### On Show Callback
An onShow callback function can be attached to each toast instance. The callback will be invoked upon toast add.
Expand Down

0 comments on commit 0e6cdeb

Please sign in to comment.