
Solid Error
From syxUI — written for both platforms, not translated between them.
A filled error banner.
Banners · SwiftUI · iOS 17
- banners
- swiftui
The actual source
BannerErrorSolid.swift
// Solid Error · syxUI · https://syxui.dev/components/bt-error-solid
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
let btRed = Color(red: 0.90, green: 0.24, blue: 0.28)
func solidBanner(_ icon: String, _ color: Color, _ title: String, _ subtitle: String) -> some View {
HStack(spacing: 12) {
Image(systemName: icon).font(.system(size: 20)).foregroundStyle(.white)
VStack(alignment: .leading, spacing: 2) { Text(title).font(.system(size: 14, weight: .semibold)).foregroundStyle(.white); Text(subtitle).font(.system(size: 13)).foregroundStyle(.white.opacity(0.85)) }
Spacer(minLength: 8)
Image(systemName: "xmark").font(.system(size: 12, weight: .bold)).foregroundStyle(.white.opacity(0.8))
}.padding(14).frame(width: 330).background(color, in: RoundedRectangle(cornerRadius: 14, style: .continuous)).shadow(color: color.opacity(0.3), radius: 10, y: 4)
}
struct BannerErrorSolid: View { var body: some View { solidBanner("wifi.slash", btRed, "No connection", "Some features may be unavailable.") } }
iOS 17 · No dependencies
Dependencies
- SwiftUI
- No external dependencies
Requires iOS 17


