customizable-toast-notification 3.3.0 → 3.3.1
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 +25 -12
- package/dist/index.esm.mjs +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ A simple and highly customizable toast notification library for modern JavaScrip
|
|
|
39
39
|
- Adjustable display duration and positioning on the screen.
|
|
40
40
|
- Close button functionality for user control.
|
|
41
41
|
- Animation effects for a smooth appearance and disappearance.
|
|
42
|
+
- **NEW**: Optional animated progress bar synced to duration
|
|
42
43
|
|
|
43
44
|
## Installation
|
|
44
45
|
|
|
@@ -97,23 +98,35 @@ Creates a toast notification with the provided options.
|
|
|
97
98
|
|
|
98
99
|
#### Parameters
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
### ⚙️ Options
|
|
102
|
+
|
|
103
|
+
| Option | Type | Default | Description |
|
|
104
|
+
| ------------------- | --------- | --------------- | ----------------------------------------------------- |
|
|
105
|
+
| `message` | `string` | Based on `type` | The toast content/message. |
|
|
106
|
+
| `duration` | `number` | `3000` | Time in milliseconds to auto-dismiss. |
|
|
107
|
+
| `position` | `string` | `bottom-right` | Position on screen (`top-left`, `bottom-right`, etc.) |
|
|
108
|
+
| `type` | `string` | `info` | One of: `info`, `success`, `error`, `warning` |
|
|
109
|
+
| `backgroundColor` | `string` | Based on `type` | Override background color. |
|
|
110
|
+
| `textColor` | `string` | `white` | Override text color. |
|
|
111
|
+
| `showCloseButton` | `boolean` | `false` | Show a close (×) button. |
|
|
112
|
+
| `animationDuration` | `string` | `0.5s` | CSS duration for fade in/out. |
|
|
113
|
+
| `animationEasing` | `string` | `ease` | CSS easing function for transitions. |
|
|
114
|
+
| `showProgressBar` | `boolean` | `false` | Show a countdown progress bar. |
|
|
115
|
+
| `progressColor` | `string` | `textColor` | Color of the progress bar. |
|
|
116
|
+
| `progressHeight` | `string` | `4px` | Height of the progress bar. |
|
|
117
|
+
| `progressPosition` | `string` | `bottom` | Position of the progress bar: `top` or `bottom`. |
|
|
110
118
|
|
|
111
119
|
#### Example
|
|
112
120
|
|
|
113
121
|
```javascript
|
|
114
122
|
createToast({
|
|
115
|
-
message: "
|
|
116
|
-
type: "
|
|
123
|
+
message: "Uploading file...",
|
|
124
|
+
type: "info",
|
|
125
|
+
duration: 5000,
|
|
126
|
+
showProgressBar: true,
|
|
127
|
+
progressColor: "#ffffff",
|
|
128
|
+
progressHeight: "4px",
|
|
129
|
+
progressPosition: "top",
|
|
117
130
|
});
|
|
118
131
|
```
|
|
119
132
|
|
package/dist/index.esm.mjs
CHANGED
package/dist/index.umd.js
CHANGED
package/package.json
CHANGED