{"id":26002605,"url":"https://github.com/ivan-magda/swiftui-toast","last_synced_at":"2026-05-18T14:42:57.977Z","repository":{"id":280117538,"uuid":"940987988","full_name":"ivan-magda/swiftui-toast","owner":"ivan-magda","description":"SwiftUI toasts with queue management. Uses Observable (iOS 17+). Auto-dismiss, tap-to-dismiss, 6 animation presets. VoiceOver-ready.","archived":false,"fork":false,"pushed_at":"2026-04-13T22:36:21.000Z","size":592,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-14T00:31:14.731Z","etag":null,"topics":["ios","macos","swift","swift-package-manager","swiftui","swiftui-components","toast","toast-notifications","tvos"],"latest_commit_sha":null,"homepage":"https://ivan-magda.github.io/swiftui-toast/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivan-magda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-03-01T07:57:17.000Z","updated_at":"2026-04-13T22:36:23.000Z","dependencies_parsed_at":"2025-06-07T13:34:43.685Z","dependency_job_id":"b55caafe-86d1-4c2e-9556-773aa3c3a452","html_url":"https://github.com/ivan-magda/swiftui-toast","commit_stats":null,"previous_names":["ivan-magda/swiftui-toast"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ivan-magda/swiftui-toast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-magda%2Fswiftui-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-magda%2Fswiftui-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-magda%2Fswiftui-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-magda%2Fswiftui-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivan-magda","download_url":"https://codeload.github.com/ivan-magda/swiftui-toast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-magda%2Fswiftui-toast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33181752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","macos","swift","swift-package-manager","swiftui","swiftui-components","toast","toast-notifications","tvos"],"created_at":"2025-03-05T19:07:53.048Z","updated_at":"2026-05-18T14:42:57.972Z","avatar_url":"https://github.com/ivan-magda.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftUIToast\n\n[![CI](https://github.com/ivan-magda/swiftui-toast/actions/workflows/swift.yml/badge.svg)](https://github.com/ivan-magda/swiftui-toast/actions/workflows/swift.yml)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fivan-magda%2Fswiftui-toast%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ivan-magda/swiftui-toast)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fivan-magda%2Fswiftui-toast%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ivan-magda/swiftui-toast)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n**Queue-managed toast notifications for modern SwiftUI.** Built on `@Observable` (iOS 17+). Toasts queue automatically - no more overlapping messages.\n\n\u003cp align=\"leading\"\u003e\n  \u003cimg src=\"demo/toast-types.gif\" width=\"200\" alt=\"Toast Types\"\u003e\n  \u003cimg src=\"demo/animations.gif\" width=\"200\" alt=\"Animations\"\u003e\n  \u003cimg src=\"demo/custom.gif\" width=\"200\" alt=\"Custom Toasts\"\u003e\n  \u003cimg src=\"demo/queue.gif\" width=\"200\" alt=\"Queue Management\"\u003e\n\u003c/p\u003e\n\n## Why SwiftUIToast?\n\n| | SwiftUIToast | AlertToast |\n|---|:---:|:---:|\n| Architecture | `@Observable` | `@Published` (Combine) |\n| Toast Queue | ✅ Built-in, automatic | ❌ Manual |\n| Min iOS | 17.0 | 13.0 |\n| Swift 6 | ✅ Full concurrency support | ⚠️ Partial |\n| Strict Sendable | ✅ | ❌ |\n\n**Choose SwiftUIToast if:** You're targeting iOS 17+ and want modern SwiftUI patterns without Combine boilerplate.\n\n**Choose AlertToast if:** You need iOS 13–16 support.\n\n## Features\n\n- **3 toast types** — `.info`, `.success`, `.error` with semantic styling\n- **Automatic queue** — Fire 5 toasts at once; they display sequentially (max 10 in queue, configurable)\n- **6 animation presets** — `.slide`, `.fade`, `.scale`, `.bounce`, `.flip`, `.slideWithBounce`\n- **Custom content** — Any SwiftUI view as toast content\n- **Auto-dismiss** — Configurable duration (default 2s)\n- **Tap-to-dismiss** — Optional, enabled by default\n- **Top or bottom** — Position toasts where you need them\n- **VoiceOver ready** — Proper accessibility labels and traits\n\n## Requirements\n\n- iOS 17.0+ / macOS 14.0+ / tvOS 17.0+\n- Swift 6.0+\n- Xcode 16.0+\n\n## Installation\n\nAdd to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/ivan-magda/swiftui-toast.git\", from: \"1.2.0\")\n]\n```\n\nOr in Xcode: File → Add Package Dependencies → paste the URL.\n\n## Quick Start\n\n### 1. Add ToastManager to your app\n\n```swift\nimport SwiftUI\nimport SwiftUIToast\n\n@main\nstruct MyApp: App {\n    @State private var toastManager = ToastManager()\n    \n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .environment(toastManager)\n        }\n    }\n}\n```\n\n### 2. Show a toast\n\n```swift\nstruct ContentView: View {\n    @State private var showToast = false\n    \n    var body: some View {\n        Button(\"Save\") {\n            showToast = true\n        }\n        .toast(isPresented: $showToast, message: \"Saved!\", type: .success)\n    }\n}\n```\n\nThat's it. The toast auto-dismisses after 2 seconds.\n\n## Usage\n\n### Predefined Types\n\n```swift\n// Info (default blue)\n.toast(isPresented: $show, message: \"Syncing...\", type: .info)\n\n// Success (green checkmark)\n.toast(isPresented: $show, message: \"Done!\", type: .success)\n\n// Error (red X)\n.toast(isPresented: $show, message: \"Failed\", type: .error)\n```\n\n### Custom Content\n\n```swift\n.toast(isPresented: $show, configuration: .top) {\n    HStack(spacing: 8) {\n        Image(systemName: \"star.fill\")\n            .foregroundStyle(.yellow)\n        Text(\"Added to favorites\")\n            .fontWeight(.medium)\n    }\n    .padding(.horizontal, 16)\n    .padding(.vertical, 12)\n    .background(.ultraThinMaterial, in: Capsule())\n}\n```\n\n### Animation Presets\n\n```swift\n.toast(isPresented: $show, message: \"Bounce!\", configuration: .bouncy())\n.toast(isPresented: $show, message: \"Fade!\", configuration: .fade())\n.toast(isPresented: $show, message: \"Flip!\", configuration: .flip())\n```\n\n### Full Configuration\n\n```swift\nlet config = ToastConfiguration(\n    duration: 3.0,           // seconds (0 = no auto-dismiss)\n    position: .top,          // .top or .bottom\n    tapToDismiss: true,\n    dismissDelay: 0.2,       // delay before dismiss animation\n    animation: .bounce()\n)\n\n.toast(\n    isPresented: $show,\n    message: \"Custom config\",\n    type: .success,\n    configuration: config\n)\n```\n\n### Queue Management\n\nMultiple toasts queue automatically:\n\n```swift\nstruct ContentView: View {\n    @Environment(ToastManager.self) private var toastManager\n    @State private var toast1 = false\n    @State private var toast2 = false\n    @State private var toast3 = false\n    \n    var body: some View {\n        Button(\"Show 3 Toasts\") {\n            toast1 = true\n            toast2 = true\n            toast3 = true\n        }\n        .toast(isPresented: $toast1, message: \"First\", type: .info)\n        .toast(isPresented: $toast2, message: \"Second\", type: .success)\n        .toast(isPresented: $toast3, message: \"Third\", type: .error)\n    }\n}\n```\n\nToasts display one at a time, in order. Queue holds up to 10 by default.\n\n## Configuration Presets\n\n| Preset | Position | Animation |\n|--------|----------|-----------|\n| `.standard` | bottom | slide |\n| `.top` | top | slide |\n| `.bottom` | bottom | slide |\n| `.bouncy()` | bottom | bounce |\n| `.fade()` | bottom | fade |\n| `.flip()` | bottom | flip |\n\n## Documentation\n\nFull API documentation available at [Swift Package Index](https://swiftpackageindex.com/ivan-magda/swiftui-toast/documentation/swiftuitoast).\n\n## Contributing\n\nIssues and PRs welcome. Please:\n\n1. Check existing issues first\n2. Include reproduction steps for bugs\n3. Run `swiftlint --strict` before submitting PRs\n\n## License\n\nMIT. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-magda%2Fswiftui-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivan-magda%2Fswiftui-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-magda%2Fswiftui-toast/lists"}