Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Toast.svelte
notifications.js
<script>
// Follow @kevmodrome on Twitter for more fun Svelte things: https://twitter.com/kevmodrome
import {notifications} from './notifications.js'
import Toast from './Toast.svelte'
</script>
<button on:click={() => notifications.info('Wait a INFO...', 100)}>
info!
</button>
<button on:click={() => notifications.warning('Wait a moment...', 5000)}>
Warn!
</button>
<button on:click={() => notifications.success('You did it!', 3000)}>
Succeed!
</button>
<button on:click={() => notifications.danger('STOP NOW!', 500)}>
Danger!
</button>
<button on:click={() => notifications.default('default', 1000)}>
Default!
</button>
<Toast />
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */