react-toast-msg 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# 🚀 react-toast-msg
|
|
2
|
+
|
|
3
|
+
  
|
|
4
|
+
|
|
5
|
+
A lightweight, zero-config, customizable React toast notification library — just plug and play.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Extremely fast and minimal
|
|
10
|
+
- Works with both `import` and `require`
|
|
11
|
+
- Easy to style with utility classes
|
|
12
|
+
- Works with React 18+
|
|
13
|
+
- Supports multiple variants (success, error and more coming soon)
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install react-toast-msg
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### 1. Add the `ToastContainer` at the root of your app (once):
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
import { ToastContainer, toast } from 'react-toast-msg';
|
|
27
|
+
|
|
28
|
+
function App() {
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<ToastContainer />
|
|
32
|
+
<button onClick={() => toast.success('This is a success toast!')}>Show Success Toast</button>
|
|
33
|
+
<button onClick={() => toast.error('This is an error toast!')}>Show Error Toast</button>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Variants
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
toast.success('Success message!');
|
|
43
|
+
toast.error('Something went wrong!');
|
|
44
|
+
|
|
45
|
+
// More coming soon
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Customization (Coming Soon)
|
|
49
|
+
|
|
50
|
+
| Property | Description | Default |
|
|
51
|
+
| ---------- | ------------------------------------- | ------- |
|
|
52
|
+
| `duration` | Duration of the toast in milliseconds | `3000` |
|
|
53
|
+
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
> react-toast-msg is an open-source project — and you can help make it better! Whether you want to:
|
|
57
|
+
|
|
58
|
+
- Suggest new features
|
|
59
|
+
- Improve performance or accessibility
|
|
60
|
+
- Fix bugs
|
|
61
|
+
- Refactor code or improve documentation
|
|
62
|
+
|
|
63
|
+
We’d love your input!
|
|
64
|
+
|
|
65
|
+
Start by checking out the [GitHub repo](https://github.com/sudhucodes/react-toast-msg) — issues, discussions, and PRs are welcome. Let's build something amazing together 🚀
|
|
66
|
+
|
|
67
|
+
## Links
|
|
68
|
+
|
|
69
|
+
- [GitHub Repo](https://github.com/sudhucodes/react-toast-msg)
|
|
70
|
+
- [npm Package](https://www.npmjs.com/package/react-toast-msg)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-toast-msg",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "A lightweight, customizable React toast notification library with zero-config and fast setup.",
|
|
5
5
|
"main": "dist/react-toast-msg.umd.js",
|
|
6
6
|
"module": "dist/react-toast-msg.es.js",
|