react-toast-msg 2.5.5 → 2.5.6

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.
Files changed (3) hide show
  1. package/LICENSE.md +21 -21
  2. package/README.md +140 -140
  3. package/package.json +2 -1
package/LICENSE.md CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 SudhuCodes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 SudhuCodes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,140 +1,140 @@
1
- # React Toast MSG - (SudhuCodes)
2
-
3
- A lightweight and customizable React toast notification library.
4
-
5
- ![Version](https://img.shields.io/npm/v/react-toast-msg)
6
- ![License](https://img.shields.io/npm/l/react-toast-msg)
7
- ![Downloads](https://img.shields.io/npm/dt/react-toast-msg)
8
-
9
- ![React Toast MSG](https://github.com/user-attachments/assets/c91fd623-a733-4634-88b7-2bb0f30366ff 'React Toast MSG')
10
-
11
- ---
12
-
13
- ## Features
14
-
15
- - Lightweight & fast
16
- - Tailwind CSS based styling
17
- - Global & per-toast configuration
18
- - Multiple toast variants
19
- - Auto close with animation
20
- - Manual close button support
21
-
22
- ## Installation
23
-
24
- ```bash
25
- npm i react-toast-msg
26
- ```
27
-
28
- ## Install Tailwind CSS
29
-
30
- Make sure you have Tailwind CSS installed in your project.
31
-
32
- ### Import CSS
33
-
34
- In your global CSS file (e.g., `index.css` or `App.css`), import the library's CSS:
35
-
36
- ```css
37
- @import 'react-toast-msg/style.css';
38
- ```
39
-
40
- ---
41
-
42
- ## Usage
43
-
44
- ### 1. Add `ToastContainer` at the root of your application:
45
-
46
- ```jsx
47
- import { toast, ToastContainer } from 'react-toast-msg';
48
-
49
- export default function Example() {
50
- return (
51
- <>
52
- <ToastContainer autoClose={3000} closeButton={true} />
53
- <button onClick={() => toast('Default toast')}>Default</button>
54
- <button onClick={() => toast.success('Success toast')}>Success</button>
55
- {/* rest */}
56
- <button onClick={() => toast.success('Success toast', { duration: 5000, closeButton: false })}>
57
- Success with duration
58
- </button>
59
- </>
60
- );
61
- }
62
- ```
63
-
64
- ---
65
-
66
- ## Custom Auto-Close Duration
67
-
68
- You can now define a custom timeout per toast.
69
-
70
- | Usage Example | Description |
71
- | ----------------------------------------------- | ------------------------------------ |
72
- | `toast('Message')` | Default timeout |
73
- | `toast('Message', { duration: 1000 })` | Closes after 1000ms (1 second) |
74
- | `toast.success('Saved')` | Success toast |
75
- | `toast.success('Saved', { duration: 5000 })` | Success toast closes after 5 seconds |
76
- | `toast.error('Error', { closeButton: true })` | Error toast with close button |
77
- | `toast.warning('Warn', { closeButton: false })` | Warning without close button |
78
-
79
- > Per-toast options always override ToastContainer defaults.
80
-
81
- ### Example:
82
-
83
- ```jsx
84
- <button onClick={() => toast('This will close in 1 second', { duration: 1000 })}>
85
- Show 1s Toast
86
- </button>
87
-
88
- <button onClick={() => toast.success('Success - 5s', { duration: 5000 })}>
89
- Show 5s Success Toast
90
- </button>
91
- ```
92
-
93
- ---
94
-
95
- ## ToastContainer Props
96
-
97
- | Prop | Type | Default | Description |
98
- | ----------- | ------- | ------- | ------------------------------------------------- |
99
- | autoClose | number | 3000 | Default close time in milliseconds for all toasts |
100
- | closeButton | boolean | false | Close button visibility for all toasts |
101
-
102
- Usage:
103
-
104
- ```jsx
105
- <ToastContainer autoClose={3000} closeButton={false} /> // Default
106
- ```
107
-
108
- ---
109
-
110
- ## Available Toast Variants
111
-
112
- ```js
113
- toast('Default message');
114
- toast.success('Success message');
115
- toast.error('Error occurred');
116
- toast.warning('Warning message');
117
- ```
118
-
119
- ---
120
-
121
- ## Contributing
122
-
123
- Contributions are welcome. You can:
124
-
125
- - Report issues
126
- - Suggest features
127
- - Submit pull requests
128
- - Improve documentation or code quality
129
-
130
- Repository: [https://github.com/sudhucodes/react-toast-msg](https://github.com/sudhucodes/react-toast-msg)
131
-
132
- ---
133
-
134
- ## License
135
-
136
- react-toast-msg is [MIT licensed](./LICENSE).
137
-
138
- ---
139
-
140
- <p align="center"> <sub>© 2025 SudhuCodes — All rights reserved.</sub> </p>
1
+ # React Toast MSG - (SudhuCodes)
2
+
3
+ A lightweight and customizable React toast notification library.
4
+
5
+ ![Version](https://img.shields.io/npm/v/react-toast-msg)
6
+ ![License](https://img.shields.io/npm/l/react-toast-msg)
7
+ ![Downloads](https://img.shields.io/npm/dt/react-toast-msg)
8
+
9
+ ![React Toast MSG](https://github.com/user-attachments/assets/c91fd623-a733-4634-88b7-2bb0f30366ff 'React Toast MSG')
10
+
11
+ ---
12
+
13
+ ## Features
14
+
15
+ - Lightweight & fast
16
+ - Tailwind CSS based styling
17
+ - Global & per-toast configuration
18
+ - Multiple toast variants
19
+ - Auto close with animation
20
+ - Manual close button support
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm i react-toast-msg
26
+ ```
27
+
28
+ ## Install Tailwind CSS
29
+
30
+ Make sure you have Tailwind CSS installed in your project.
31
+
32
+ ### Import CSS
33
+
34
+ In your global CSS file (e.g., `index.css` or `App.css`), import the library's CSS:
35
+
36
+ ```css
37
+ @import 'react-toast-msg/style.css';
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Usage
43
+
44
+ ### 1. Add `ToastContainer` at the root of your application:
45
+
46
+ ```jsx
47
+ import { toast, ToastContainer } from 'react-toast-msg';
48
+
49
+ export default function Example() {
50
+ return (
51
+ <>
52
+ <ToastContainer autoClose={3000} closeButton={true} />
53
+ <button onClick={() => toast('Default toast')}>Default</button>
54
+ <button onClick={() => toast.success('Success toast')}>Success</button>
55
+ {/* rest */}
56
+ <button onClick={() => toast.success('Success toast', { duration: 5000, closeButton: false })}>
57
+ Success with duration
58
+ </button>
59
+ </>
60
+ );
61
+ }
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Custom Auto-Close Duration
67
+
68
+ You can now define a custom timeout per toast.
69
+
70
+ | Usage Example | Description |
71
+ | ----------------------------------------------- | ------------------------------------ |
72
+ | `toast('Message')` | Default timeout |
73
+ | `toast('Message', { duration: 1000 })` | Closes after 1000ms (1 second) |
74
+ | `toast.success('Saved')` | Success toast |
75
+ | `toast.success('Saved', { duration: 5000 })` | Success toast closes after 5 seconds |
76
+ | `toast.error('Error', { closeButton: true })` | Error toast with close button |
77
+ | `toast.warning('Warn', { closeButton: false })` | Warning without close button |
78
+
79
+ > Per-toast options always override ToastContainer defaults.
80
+
81
+ ### Example:
82
+
83
+ ```jsx
84
+ <button onClick={() => toast('This will close in 1 second', { duration: 1000 })}>
85
+ Show 1s Toast
86
+ </button>
87
+
88
+ <button onClick={() => toast.success('Success - 5s', { duration: 5000 })}>
89
+ Show 5s Success Toast
90
+ </button>
91
+ ```
92
+
93
+ ---
94
+
95
+ ## ToastContainer Props
96
+
97
+ | Prop | Type | Default | Description |
98
+ | ----------- | ------- | ------- | ------------------------------------------------- |
99
+ | autoClose | number | 3000 | Default close time in milliseconds for all toasts |
100
+ | closeButton | boolean | false | Close button visibility for all toasts |
101
+
102
+ Usage:
103
+
104
+ ```jsx
105
+ <ToastContainer autoClose={3000} closeButton={false} /> // Default
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Available Toast Variants
111
+
112
+ ```js
113
+ toast('Default message');
114
+ toast.success('Success message');
115
+ toast.error('Error occurred');
116
+ toast.warning('Warning message');
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Contributing
122
+
123
+ Contributions are welcome. You can:
124
+
125
+ - Report issues
126
+ - Suggest features
127
+ - Submit pull requests
128
+ - Improve documentation or code quality
129
+
130
+ Repository: [https://github.com/sudhucodes/react-toast-msg](https://github.com/sudhucodes/react-toast-msg)
131
+
132
+ ---
133
+
134
+ ## License
135
+
136
+ react-toast-msg is [MIT licensed](./LICENSE).
137
+
138
+ ---
139
+
140
+ <p align="center"> <sub>© 2025 SudhuCodes — All rights reserved.</sub> </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-toast-msg",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "description": "A lightweight, customizable React toast notification library with zero-config and fast setup.",
5
5
  "files": [
6
6
  "dist"
@@ -60,6 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "clsx": "^2.1.1",
63
+ "docstra": "^1.9.7",
63
64
  "tailwind-merge": "^3.4.0"
64
65
  }
65
66
  }