@arashaltafi/react-toast
v1.4.0
Published
react toast library
Downloads
86
Maintainers
Readme
My Toast Library
A Simple Toast & Tooltip Library, Built With React and TypeScript.
Installation
npm install react-toast
Usage
import { showToast } from '@arashaltafi/react-toast';
import { Tooltip } from '@arashaltafi/react-toast';
// show 'error' Toast
showToast('Error Toast Message', 'error', true, 5000)
// show 'success' Toast
showToast('Success Toast Message', 'success', true, 5000)
// show Tooltip
<Tooltip content="This is a tooltip">
<p>1</p>
<p>2</p>
<p>3</p>
</Tooltip>
Parameter Toast
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| text
| string
| Required |
| color
| "success" or "error"
| Required |
| pauseOnHover
| boolean
| Default false |
| timeWait
| number
| Default 3000 ms |
Parameter Tooltip
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| children
| children React Node
| Required |
| content
| "string"
| Required |