Autumn Sale50% offCOMPOT
Banners & PromosPro ComponentiOS 16.0+Xcode 15+

Product Banner with Overlay

Hero media banner with gradient overlay, title, and quick-favorite heart button.

SwiftUI Implementation

Pure Vanilla Swift • No Dependencies
productBannerWOverlayTitleFavorite.swift
import SwiftUI

struct ProductBannerWOverlayTitleFavorite: View {
    
    // YOu can download the image here: https://drive.google.com/file/d/1GVdHPmkFmwQ1-DAh2k6kUv1HVDk0toIA/view?usp=sharing
    
    @State private var isFavorite: Bool = false
    
    var body: some View {
        Image("sportcar")
            .resizable()
            .scaledToFill()
            .frame(width: 200, height: 140)
            .overlay(alignment: .top) {
                HStack {
                    Text("Ultradon 3000")
                    Spacer()
                    Button {
                        isFavorite.toggle()
                    } label: {
                        Image(systemName: "heart")
                            .symbolVariant(isFavorite ? .fill : .none)
                    }
                    .buttonStyle(PlainButtonStyle())
                }
                .font(.caption)
                .fontWeight(.medium)
                .foregroundStyle(.white)
                .padding(.horizontal, 8)
                .padding(.vertical, 4)
                .background(.ultraThinMaterial.opacity(0.8))
            }
            .clipShape(.rect(cornerRadius: 8))

    }
}

#Preview {
    ProductBannerWOverlayTitleFavorite()
}

Ready to copy and paste directly into any Xcode project running iOS 16.0+.

Recommended Use Cases

  • First-run onboarding flows and feature introductions
  • App settings, preferences, and account configuration screens
  • Dashboard overviews, stats tracking, and metric highlights

Component Details

iOS Compatibility
iOS 16.0+
Xcode Version
Xcode 15+
Platform
iOS
License Tier
Pro
Themes & Contexts
settingsonboardingdashboard
C

Compot for iOS

Native SwiftUI playground app

Preview all 130+ components interactively on your device and copy code straight to Xcode with 1 tap.

Get Compot on the App Store