PHPackages                             stinger-soft/toastr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. stinger-soft/toastr

ActiveComponent

stinger-soft/toastr
===================

Shim repository for https://github.com/CodeSeven/toastr

2.1.3(9y ago)01.5k↓100%MITJavaScript

Since May 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Stinger-Soft/toastr)[ Packagist](https://packagist.org/packages/stinger-soft/toastr)[ RSS](/packages/stinger-soft-toastr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

toastr
======

[](#toastr)

**toastr** is a Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.

[![Build Status](https://camo.githubusercontent.com/0cedba8128ec1871b6d28a061d22af0697a5da4a74b2b22283febf897533b80b/68747470733a2f2f7472617669732d63692e6f72672f436f6465536576656e2f746f617374722e737667)](https://travis-ci.org/CodeSeven/toastr)Browser testing provided by BrowserStack.

Current Version
---------------

[](#current-version)

2.1.3

Demo
----

[](#demo)

- Demo can be found at
- [Demo using FontAwesome icons with toastr](http://plnkr.co/edit/6W9URNyyp2ItO4aUWzBB?p=preview)

[CDNjs](https://cdnjs.com/libraries/toastr.js)
----------------------------------------------

[](#cdnjs)

Toastr is hosted at CDN JS

#### Debug

[](#debug)

- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js)
- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css)

#### Minified

[](#minified)

- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js)
- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css)

Install
-------

[](#install)

#### [NuGet Gallery](http://nuget.org/packages/toastr)

[](#nuget-gallery)

```
Install-Package toastr

```

#### [Bower](http://bower.io/search/?q=toastr)

[](#bower)

```
bower install toastr

```

#### [npm](https://www.npmjs.com/package/toastr)

[](#npm)

```
npm install --save toastr

```

Wiki and Change Log
-------------------

[](#wiki-and-change-log)

[Wiki including Change Log](https://github.com/CodeSeven/toastr/wiki)

Breaking Changes
----------------

[](#breaking-changes)

\####Animation Changes The following animations options have been deprecated and should be replaced:

- Replace `options.fadeIn` with `options.showDuration`
- Replace `options.onFadeIn` with `options.onShown`
- Replace `options.fadeOut` with `options.hideDuration`
- Replace `options.onFadeOut` with `options.onHidden`

Quick Start
-----------

[](#quick-start)

### 3 Easy Steps

[](#3-easy-steps)

For other API calls, see the [demo](http://codeseven.github.io/toastr/demo.html).

1. Link to toastr.css ``
2. Link to toastr.js ``
3. use toastr to display a toast for info, success, warning or error

    ```
    // Display an info toast with no title
    toastr.info('Are you the 6 fingered man?')
    ```

### Other Options

[](#other-options)

```
// Display a warning toast, with no title
toastr.warning('My name is Inigo Montoya. You killed my father, prepare to die!')

// Display a success toast, with a title
toastr.success('Have fun storming the castle!', 'Miracle Max Says')

// Display an error toast, with a title
toastr.error('I do not think that word means what you think it means.', 'Inconceivable!')

// Immediately remove current toasts without using animation
toastr.remove()

// Remove current toasts using animation
toastr.clear()

// Override global options
toastr.success('We do have the Kapua suite available.', 'Turtle Bay Resort', {timeOut: 5000})
```

### Escape HTML characters

[](#escape-html-characters)

In case you want to escape HTML charaters in title and message

```
toastr.options.escapeHtml = true;

```

### Close Button

[](#close-button)

Optionally enable a close button

```
toastr.options.closeButton = true;
```

Optionally override the close button's HTML.

```
toastr.options.closeHtml = '';
```

You can also override the CSS/LESS for `#toast-container .toast-close-button`

Optionally override the hide animation when the close button is clicked (falls back to hide configuration).

```
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 300;
toastr.options.closeEasing = 'swing';
```

### Display Sequence

[](#display-sequence)

Show newest toast at bottom (top is default)

```
toastr.options.newestOnTop = false;
```

### Callbacks

[](#callbacks)

```
// Define a callback for when the toast is shown/hidden/clicked
toastr.options.onShown = function() { console.log('hello'); }
toastr.options.onHidden = function() { console.log('goodbye'); }
toastr.options.onclick = function() { console.log('clicked'); }
toastr.options.onCloseClick = function() { console.log('close button clicked'); }
```

### Animation Options

[](#animation-options)

Toastr will supply default animations, so you do not have to provide any of these settings. However you have the option to override the animations if you like.

\####Easings Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.

```
toastr.options.showEasing = 'swing';
toastr.options.hideEasing = 'linear';
toastr.options.closeEasing = 'linear';
```

Using the jQuery Easing plugin ()

```
toastr.options.showEasing = 'easeOutBounce';
toastr.options.hideEasing = 'easeInBack';
toastr.options.closeEasing = 'easeInBack';
```

\####Animation Method Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.

```
toastr.options.showMethod = 'slideDown';
toastr.options.hideMethod = 'slideUp';
toastr.options.closeMethod = 'slideUp';
```

\###Prevent Duplicates Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.

```
toastr.options.preventDuplicates = true;
```

\###Timeouts Control how toastr interacts with users by setting timeouts appropriately. Timeouts can be disabled by setting them to 0.

```
toastr.options.timeOut = 30; // How long the toast will display without user interaction
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
```

\###Progress Bar Visually indicate how long before a toast expires.

```
toastr.options.progressBar = true;
```

### rtl

[](#rtl)

Flip the toastr to be displayed properly for right-to-left languages.

```
toastr.options.rtl = true;
```

Building Toastr
---------------

[](#building-toastr)

To build the minified and css versions of Toastr you will need [node](http://nodejs.org) installed. (Use Homebrew or Chocolatey.)

```
npm install -g gulp karma-cli
npm install

```

At this point the dependencies have been installed and you can build Toastr

- Run the analytics `gulp analyze`
- Run the test `gulp test`
- Run the build `gulp`

Contributing
------------

[](#contributing)

For a pull request to be considered it must resolve a bug, or add a feature which is beneficial to a large audience.

Pull requests must pass existing unit tests, CI processes, and add additional tests to indicate successful operation of a new feature, or the resolution of an identified bug.

Requests must be made against the `develop` branch. Pull requests submitted against the `master` branch will not be considered.

All pull requests are subject to approval by the repository owners, who have sole discretion over acceptance or denial.

Authors
-------

[](#authors)

**John Papa**

- [http://twitter.com/John\_Papa](http://twitter.com/John_Papa)

**Tim Ferrell**

- [http://twitter.com/ferrell\_tim](http://twitter.com/ferrell_tim)

**Hans Fjällemark**

-

Credits
-------

[](#credits)

Inspired by .

Copyright
---------

[](#copyright)

Copyright © 2012-2015

License
-------

[](#license)

toastr is under MIT license -

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~287 days

Total

2

Last Release

3354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2f01fea764b969355a878a17f1a26cee49f4acccf17a79fd36527042e07384c?d=identicon)[Viburnum](/maintainers/Viburnum)

---

Top Contributors

[![Viburnum](https://avatars.githubusercontent.com/u/2122889?v=4)](https://github.com/Viburnum "Viburnum (4 commits)")[![grimmlink](https://avatars.githubusercontent.com/u/3241292?v=4)](https://github.com/grimmlink "grimmlink (1 commits)")

### Embed Badge

![Health badge](/badges/stinger-soft-toastr/health.svg)

```
[![Health](https://phpackages.com/badges/stinger-soft-toastr/health.svg)](https://phpackages.com/packages/stinger-soft-toastr)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
