# simple-toast-library

> Toast library

Latest version **1.0.4** (published 2023-01-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-toast-library
pnpm add simple-toast-library
yarn add simple-toast-library
bun add simple-toast-library
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-01-18 |
| First published | 2023-01-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 84.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aleksandr Saponchik |
| Maintainers | alex-sapon |
| Keywords | toast, toast library |

## Links

- npm: https://www.npmjs.com/package/simple-toast-library
- Homepage: https://alex-sapon.github.io/toast-lib/
- npm.io page: https://npm.io/package/simple-toast-library

## 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

- 1.0.4 (latest) — 2023-01-18
- 1.0.3 — 2023-01-18
- 1.0.2 — 2023-01-16
- 1.0.1 — 2023-01-16
- 1.0.0 — 2023-01-16

## README

# react-toast-library

## Installation

```
$ npm install --save react-toast-library
$ yarn add react-toast-library
```

## Example

```jsx
  import React from 'react';
  import { ToastContainer, useToast } from 'react-toast-library';
  
  function App(){
    const { toaster } = useToast(3);
    
    const handleClick = () => {
      toaster.success('New toast', {
        title: 'Success',
        autoClose: 3000,
        position: 'bottom-left',
        color: '#fff',
        backgroundColor: '#37E29A',
      });
    }
    
    return (
      <div>
        <button onClick={handleClick}>add toast</button>
        <ToastContainer
          distance={15}
          animationName='flip'
        />
      </div>
    );
  }
```

## Demo

[Link to demo](https://alex-sapon.github.io/toast-lib/)

## Documentation

### useToast

- besides the ***message***, you can set ***title***;
- ***autoClose***: you must specify the delay in milliseconds, default delay - 3000ms;
- ***position*** has 6 values: bottom-left, bottom-middle, bottom-right, top-left, top-middle, top-right. Default 
  position - bottom-left;
- and you can also set the ***color*** of the text and ***backgroundColor***.

### ToastContainer

- ***distance***: specify the distance between messages in pixels, default 15px;
- ***animation*** has 5 values: wobble, bounce, fade, flip and default - bounceUp.

## License

Licensed under ISC

---
_Source: https://npm.io/package/simple-toast-library · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
