# @anthony809/svelte-toasts

> Svelte Toasts simple component to add PopUp massage on your site.

Latest version **0.0.2** (published 2023-01-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @anthony809/svelte-toasts
pnpm add @anthony809/svelte-toasts
yarn add @anthony809/svelte-toasts
bun add @anthony809/svelte-toasts
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-01-11 |
| First published | 2023-01-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | anthony809 |
| Maintainers | anthony809 |
| Keywords | svelte, sveltekit, toasts, toast, popUp |

## Links

- npm: https://www.npmjs.com/package/@anthony809/svelte-toasts
- npm.io page: https://npm.io/package/@anthony809/svelte-toasts

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2023-01-11
- 0.0.1 — 2023-01-03
- 0.0.0 — 2023-01-03

## README

## Svelte Toasts simple component to add PopUp massage on your site.
### Install Svelte Toasts
```
npm install @anthony809/svelte-toasts
```
#### How to use Svelte Toasts
Import ```Toasts``` from ```@anthony809/svelte-toasts/Toasts.svelte```
``` javascript
import Toasts from "@anthony809/svelte-toasts/Toasts.svelte";
```
Add ```Toasts``` to your ```+layout.svelte``` or any svelte page
``` svelte
<script lang="ts">
    import Toasts from "@anthony809/svelte-toasts/Toasts.svelte";
</script>

<Toasts />
```

### Add new toast
From ```@anthony809/svelte-toasts/index``` import the ```newToast``` function
``` svelte
<script lang="ts">
    import { newToast } from "@anthony809/svelte-toasts/index";
    // This function will run every time you click the add user button
    function addUser(){
        // Add new toast, type can be type:"error"|"ok"|"neutral" and msg:string
        // And it will send new Toast to your Toasts component in +layout.svelte
        newToast({
            type:"ok",
            msg:"New user was added"
        })
    }
</script>

<button on:click={addUser}>
    Add user
</button>
```

---
_Source: https://npm.io/package/@anthony809/svelte-toasts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
