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
-**deduplication**: Prevent duplicate toasts (see below)
204
206
-**colors**: Custom colors per toast type
205
207
-**icons**: Custom icons per toast type
206
208
-**toastStyle**, **titleStyle**, **descriptionStyle**: Global style overrides
207
209
210
+
### Deduplication
211
+
212
+
When the same toast is shown repeatedly (e.g., rapid button taps), deduplication prevents stacking identical toasts. Instead, it resets the timer and plays a feedback animation:
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:
Copy file name to clipboardExpand all lines: packages/react-native-bread/src/types.ts
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -65,10 +65,14 @@ export interface ToastTheme {
65
65
descriptionStyle: TextStyle;
66
66
/** Default duration in ms for toasts (default: 4000) */
67
67
defaultDuration: number;
68
+
/** When true, duplicate toasts reset the timer and play a feedback animation instead of stacking. Matches by title+type+description, or by `id` if provided. (default: false) */
69
+
deduplication: boolean;
68
70
}
69
71
70
72
/** Per-toast options for customizing individual toasts */
71
73
exportinterfaceToastOptions{
74
+
/** Stable key for deduplication. When set, toasts with the same `id` deduplicate and update the existing toast's content. Without an `id`, matching falls back to title+type+description against the front toast. */
/** Enable deduplication for this toast (overrides global config). Plays a pulse animation for non-error toasts or a shake for errors. Use with `id` for stable matching across different content. */
99
+
deduplication?: boolean;
94
100
}
95
101
96
102
/** Configuration options for customizing toast behavior and appearance. All properties are optional. */
0 commit comments