Skip to content
Verify Banner preview
Rendered from the SwiftUI source on this page.

Verify Banner

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

An email-verification banner.

Banners · SwiftUI · iOS 17

  • banners
  • swiftui

The actual source

BannerVerify.swift
// Verify Banner · syxUI · https://syxui.dev/components/bt-verify
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let btBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

func inlineBanner(_ icon: String, _ tint: Color, _ title: String, _ subtitle: String, action: String? = nil) -> some View {
    HStack(spacing: 12) {
        Image(systemName: icon).font(.system(size: 18)).foregroundStyle(tint)
        VStack(alignment: .leading, spacing: 2) {
            Text(title).font(.system(size: 14, weight: .semibold))
            if !subtitle.isEmpty { Text(subtitle).font(.system(size: 13)).foregroundStyle(.secondary) }
        }
        Spacer(minLength: 8)
        if let action { Text(action).font(.system(size: 13, weight: .semibold)).foregroundStyle(tint) }
    }.padding(14).frame(width: 330).background(tint.opacity(0.10), in: RoundedRectangle(cornerRadius: 14, style: .continuous)).overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(tint.opacity(0.25), lineWidth: 1))
}

struct BannerVerify: View { var body: some View { inlineBanner("envelope.badge.fill", btBlue, "Verify your email", "Check your inbox for a link.", action: "Resend") } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17