You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,7 @@ toast.success('Saved!', {
141
141
style: { backgroundColor: '#fff' },
142
142
dismissible: true,
143
143
showCloseButton: true,
144
+
deduplication: false, // Opt out of deduplication for this toast
144
145
});
145
146
```
146
147
@@ -202,10 +203,41 @@ Available options include:
202
203
-**dismissible**: Allow swipe to dismiss
203
204
-**showCloseButton**: Show X button
204
205
-**defaultDuration**: Default display time in ms
206
+
-**deduplication**: Prevent duplicate toasts (default: `true`, see below)
205
207
-**colors**: Custom colors per toast type
206
208
-**icons**: Custom icons per toast type
207
209
-**toastStyle**, **titleStyle**, **descriptionStyle**: Global style overrides
208
210
211
+
### Deduplication
212
+
213
+
Deduplication is **enabled by default**. When the same toast is shown repeatedly (e.g., rapid button taps), it prevents stacking identical toasts. Instead, it resets the timer and plays a feedback animation:
// Explicitly enable for a specific toast (redundant when global is on)
231
+
toast.success('Liked!', { deduplication: true });
232
+
```
233
+
234
+
By default, a toast is considered a duplicate when it matches the **front toast** by title, type, and description. For stable matching across different content, provide an `id` — the existing toast's content will be updated:
0 commit comments