Skip to content

Commit a86fa20

Browse files
authored
Merge pull request #80 from palerdot/patch-1
Update README example for 'animationIn/animationOut' options
2 parents 712ff43 + dce98cd commit a86fa20

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,19 @@ Voila!
9898

9999
**Note**: We rely on `animate.css` in this example as `animate__fadeIn` and `animate__fadeOut` are part of `animate.css`. We recommend using it as it's an excellent animation library, but you're not forced to. If you prefer you may also use your custom animations as long as they're valid CSS animations.
100100

101-
**Note**: `animate.css` latest version has breaking changes. Import `animate.css` by importing as
101+
**Note**: `animate.css` latest version (`v4`) has breaking changes. It introduces `animate__` prefix so that existing classes don't clash. If you still would like to use classes without prefix you can import `animate.css/animate.compat.css`
102102
```js
103+
// preferred way to import (from `v4`). Uses `animate__` prefix.
104+
import 'animate.min.css';
105+
106+
// Alternate way to use classes without prefix like `animated fadeIn`
103107
import 'animate.css/animate.compat.css'
104108
```
105109

110+
In the examples, we will be using classes with `animate__` prefix, which is the default behaviour of latest `v4` version of `animate.css`.
111+
112+
For more info on how to use `animate.css`, please refer to [animate.css docs](https://animate.style/)
113+
106114
## API
107115

108116
`store.addNotification(options)`
@@ -116,6 +124,8 @@ Manually remove a notification by id.
116124

117125
## Examples
118126

127+
128+
119129
In the following examples for brevity some options will not be mentioned. Strictly focusing on the needed options to present each example. For reference, we will be using Object spread operator on a `notification` object to have non relevant fields included as well.
120130

121131
```js
@@ -125,8 +135,8 @@ notification = {
125135
type: "success",
126136
insert: "top",
127137
container: "top-right",
128-
animationIn: ["animated", "fadeIn"],
129-
animationOut: ["animated", "fadeOut"]
138+
animationIn: ["animate__animated animate__fadeIn"], // `animate.css v4` classes
139+
animationOut: ["animate__animated animate__fadeOut"] // `animate.css v4` classes
130140
};
131141
```
132142

@@ -175,9 +185,9 @@ Will trigger a `danger` notification.
175185

176186
```js
177187
store.addNotification({
178-
...notification,
179-
animationIn: ['animated', 'fadeIn'],
180-
animationOut: ['animated', 'fadeOut']
188+
...notification,
189+
animationIn: ['animate__animated animate__fadeIn'], // `animate.css v4` classes
190+
animationOut: ['animate__animated animate__fadeOut'] // `animate.css v4` classes
181191
})
182192
```
183193

0 commit comments

Comments
 (0)