Yeti Alerts JavaScript Library Examples

Download Back To CSSScript.Com

A JavaScript library that simplifies the creation of stylish toast and growl notifications. Customize the look and feel with ease.

Usage

Create an alert

As you can notice an alert has been opened automatically.

To achieve that you only need to init the Yeti class container and use the method show to show the yeti alert.

JS code

Default alert

Init the Yeti class container and use the method show to show the yeti alert at the button event.

JS code

Severity

You can change the severity using the property severity. The available values are: 'ok', 'nok', 'warn', and 'info' (default).

HTML code
JS code

Title

You can change the severity using the property severity. The available values are: 'ok', 'nok', 'warn', and 'info' (default).

Same HTML Code as Severity ecample.

JS code

Not Fade on next alert

By default, the alerts fade when next alert appears, you can disable that by adding fadeOnNext: false property.

Same HTML Code as Severity ecample.

JS code

Timer (duration)

By default, the alerts fade ha sno time, they lasts until you close one, or if other one appears (unless you set the property fadeOnNext: false).

You can set an alert time in ms by setting time: 1000 property. At this example the alert will remain 1s.

When you set a time the alert will not be closable

Same HTML Code as Severity ecample.

JS code

Styles

By default, the alerts fade when next alert appears, you can disable that by adding fadeOnNext: false property.

Same HTML Code as Severity ecample.

JS code

Override Styles

Colors and shadows

var default value description
--yeti-bg-ok #ebffec OK alert background color
--yeti-ok #31a335 OK alert text color
--yeti-bg-nok #fdf2f1 NOK alert background color
--yeti-nok #f44336 NOK alert text color
--yeti-bg-warn #fff8ec Warn alert background color
--yeti-warn #ed7a00 Warn alert text color
--yeti-bg-info #e6f4ff Info alert background color
--yeti-info #0083ee Info alert text color
--yeti-close #777 Close button color
--yeti-shadow #00000025 Alert shadow color

Sizing and space

var default value description
--yeti-radius 5px Alert radius
--yeti-gap 10px Alert gap
--yeti-font 1em Alert font size