1.1.3 • Published 1 year ago

@bobbymannino/svelte-toaster v1.1.3

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Svelte Toaster

Description

A notification system that's:

  • TypeScript First
  • Customizable
  • Easy To Use
  • Animated

Demo

Demo Site


Installation

npm install --save-dev @bobbymannino/svelte-toaster

Usage

<!-- +layout.svelte -->

<script lang="ts">
	import { Toaster } from "@bobbymannino/svelte-toaster";
</script>

<Toaster />
<!-- +page.svelte -->

<script lang="ts">
	import { toaster } from "@bobbymannino/svelte-toaster";

	function newToast() {
		toaster.toast("DON'T BURN ME!");
	}
</script>

<button on:click="{newToast}">Toasty!</button>

Configuration

<!-- +layout.svelte -->

<Toaster xPlacement="right" yPlacement="top" />
Property NameProperty TypeProperty Default
xPlacement'left' | 'middle' | 'right''left'
yPlacement'bottom' | 'top''bottom'
<!-- +page.svelte -->

<script lang="ts">
	function newToast() {
		toaster.toast("hi there", { type: "error", icon: false, duration: 10000, colorful: true });
	}
</script>
Property NameProperty TypeProperty Default
type'error' | 'success' | 'warning' | 'help''help'
iconbooleantrue
durationnumber7000
colorfulbooleanfalse

Bugs & Features

Submit all bugs and/or feature requests to the issues panel panel on GitHub