Skip to content

Commit

Permalink
Merge pull request #28 from GodGotzi/main
Browse files Browse the repository at this point in the history
Add support for multiple Toast instances with custom IDs
  • Loading branch information
urholaukkarinen authored Oct 5, 2024
2 parents b39b386 + 54cabd2 commit 561bb96
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 561bb96

Please sign in to comment.