Here's a list of features SwiftUI Toast has to offer:
👉 Simple API
👉 Supports iOS17+
👉 Presentation modes: .top, .bottom 💎
👉 Access toast through @Environment
👉 Access the navigation with the @Environment
👉 Supports title; optional: message, icon, actions
👉 Optionally it dismisses itself after a delay
👉 Works on top of navigation bars
👉 Works with sheets
👉 Supports light and dark mode
👉 EASY 2 step setup
👉 Example Xcode Project
👉 100% Documented
toast.present(title: "Hello, toast!")
toast.present(title: "Hello, toast!", message: "This is a toast message.")
toast.present(title: "Hello, toast!", message: "This is a toast message.", icon: AnyView(icon()))
toast.present(title: "Hello, toast!", message: "This is a toast message.", icon: AnyView(icon()), actions: AnyView(actions()))
toast.present(title: "Hello, toast!", message: "This is a toast message.", icon: AnyView(icon()), actions: AnyView(actions()), alignment: .bottom)
toast.present(type: .progress)
toast.present(type: .success)
toast.present(type: .error, message: "This is an error message.", dismissAfter: .seconds(3))
Initialise the library by adding .usesSwiftUIToast() to your root view.
Access the toast in any view with @Environment(\.toast) private var toast
There's an example Xcode project waiting for you with all the use cases!
iOS17+