1
1
[ ![ npm (scoped)] ( https://img.shields.io/npm/v/@zerodevx/svelte-toast )] ( https://www.npmjs.com/package/@zerodevx/svelte-toast )
2
2
[ ![ JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( https://standardjs.com )
3
3
[ ![ Lines of code] ( https://img.shields.io/tokei/lines/github/zerodevx/svelte-toast?label=lines%20of%20code )] ( https://github.com/XAMPPRocky/tokei )
4
- [ ![ Size minified] ( https://img.shields.io/bundlephobia/min/@zerodevx/svelte-toast@latest ?label=minified )] ( https://bundlephobia.com/ )
5
- [ ![ Size gzipped] ( https://img.shields.io/bundlephobia/minzip/@zerodevx/svelte-toast@latest ?label=gzipped )] ( https://bundlephobia.com/ )
4
+ [ ![ Size minified] ( https://img.shields.io/bundlephobia/min/@zerodevx/svelte-toast?label=minified )] ( https://bundlephobia.com/ )
5
+ [ ![ Size gzipped] ( https://img.shields.io/bundlephobia/minzip/@zerodevx/svelte-toast?label=gzipped )] ( https://bundlephobia.com/ )
6
6
7
7
# svelte-toast
8
8
@@ -319,7 +319,7 @@ toast.set({ id, msg: 'Waddup!' })
319
319
#### Pausable Toasts
320
320
321
321
Progress bar tweens can now be paused when the mouse cursor (on desktop) is hovered on the toast item.
322
- This behaviour by default is ** disabled** . To enable, set option ` pausable: true ` :
322
+ This behaviour by default is ** disabled** . To enable, set option ` pausable: true ` .
323
323
324
324
``` js
325
325
toast .push (' Hover me!' , { pausable: true })
@@ -328,18 +328,18 @@ toast.push('Hover me!', { pausable: true })
328
328
#### Send Svelte Component as a Message
329
329
330
330
To support complex UI or workflows, a Svelte component can be pushed instead of a standard message if
331
- you're using this package in a Svelte project. To do so, push options with ` component ` property defined:
331
+ you're using this package in a Svelte project. To do so, push options with ` component ` defined:
332
332
333
333
``` js
334
334
import MyCustomSvelteComponent from ' ./MyCustomSvelteComponent.svelte'
335
335
336
336
toast .push ({
337
337
component: {
338
- src: MyCustomSvelteComponent, // set the `src` to the component itself (required)
338
+ src: MyCustomSvelteComponent, // set `src` to the component itself (required)
339
339
props: { // optionally pass in `props` as key/value pairs
340
340
...
341
341
},
342
- sendIdTo: ' toastId' // optionally forward the toast id to `toastId` prop
342
+ sendIdTo: ' toastId' // optionally forward toast id to `toastId` prop
343
343
},
344
344
... // any other toast options
345
345
})
@@ -353,8 +353,8 @@ const options = {
353
353
duration: 4000 , // duration of progress bar tween to the `next` value
354
354
initial: 1 , // initial progress bar value
355
355
next: 0 , // next progress value
356
+ pausable: false , // pause progress bar tween on mouse hover
356
357
dismissable: true , // allow dismiss with close button
357
- pausable: false , // allow pause on mouse hover
358
358
reversed: false , // insert new toast to bottom of stack
359
359
intro: { x: 256 }, // toast intro fly animation settings
360
360
theme: {} // css var overrides
0 commit comments