Product Banner with Overlay
Hero media banner with gradient overlay, title, and quick-favorite heart button.
SwiftUI Implementation
Pure Vanilla Swift • No DependenciesproductBannerWOverlayTitleFavorite.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
- Category
- Banners & Promos
- 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 StoreRelated SwiftUI Components
More components in Banners & Promos and related app architectures.
ButtonsiOS 16.0+
Primary Button Basic
High-emphasis prominent action button with standard SwiftUI prominence styling and haptic feedback.
View Component & Code
ButtonsiOS 16.0+
CTA Button Large Basic
Full-width, high-impact call-to-action button designed for onboarding screens, welcome flows, and paywalls.
View Component & Code
ButtonsiOS 16.0+
Secondary Button Basic
Medium-emphasis secondary action button styled for alternative user workflows and dismissal actions.
View Component & Code