From 54cabd2c216dddf3b8739fb4ce4121b8709c3dc6 Mon Sep 17 00:00:00 2001 From: Elias Gottsbacher Date: Wed, 25 Sep 2024 01:08:12 +0200 Subject: [PATCH] multiple toasts instances --- src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7e0f7a8..b576cd6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -108,6 +108,17 @@ impl Toasts { Self::default() } + /// Create a new [`Toasts`] instance with a custom id + /// + /// This can be useful if you want to have multiple toast groups + /// in the same UI. + pub fn with_id(id: Id) -> Self { + Self { + id, + ..Default::default() + } + } + /// Position where the toasts show up. /// /// The toasts will start from this position and stack up