Skip to content
Loading Toast preview
Rendered from the SwiftUI source on this page.

Loading Toast

From syxUI — written for both platforms, not translated between them.

A processing toast with a spinner.

Banners · SwiftUI · iOS 17

  • banners
  • swiftui

The actual source

LoadingToast.swift
// Loading Toast · syxUI · https://syxui.dev/components/bt-loading
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Loading toast (spinner)
struct LoadingToast: View {
    var body: some View {
        HStack(spacing: 12) { Circle().trim(from: 0, to: 0.7).stroke(.white, style: StrokeStyle(lineWidth: 2.5, lineCap: .round)).frame(width: 18, height: 18); Text("Processing your request…").font(.system(size: 14, weight: .medium)).foregroundStyle(.white); Spacer(minLength: 8) }.padding(.horizontal, 16).padding(.vertical, 13).frame(width: 300).background(Color(red: 0.15, green: 0.15, blue: 0.17), in: RoundedRectangle(cornerRadius: 14, style: .continuous)).shadow(color: .black.opacity(0.15), radius: 12, y: 5)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17