SwiftUI Images & Effects
Hero parallax image headers, custom shape masking, and tap-to-zoom spring animations. (3 components available in Compot).
1 of 3Free ComponentiOS 16.0+
Image with Text Overlay
Media container with gradient scrim and overlaid caption typography.
ImageWithTextOverlay.swift
import SwiftUI
struct ImageWithTextOverlay: View {
var body: some View {
Image(systemName: "circle")
.font(.system(size: 50, weight: .thin))
.foregroundStyle(.secondary)
.overlay(Text("❤️"), alignment: .center)
}
}
#Preview {
ImageWithTextOverlay()
}2 of 3Free ComponentiOS 16.0+
Image with Custom Mask
Image clipped with custom shape masks (stars, shields, rounded shapes).
ImageWithCustomMask.swift
import SwiftUI
// I'm using free images from: https://unsplash.com/
// You can download the image here: https://drive.google.com/file/d/1xfhSIbV6OSMB9u_lM6l_hsPzzaAL9MME/view?usp=sharing
struct ImageWMask: View {
var body: some View {
Image("fiona")
.resizable()
.scaledToFit()
.mask {
Image(systemName: "seal.fill")
.resizable()
.scaledToFit()
}
.frame(width: 100)
.shadow(color: .gray.opacity(0.6), radius: 4)
}
}
#Preview {
ImageWMask()
}3 of 3Pro ComponentiOS 16.0+
Image with Scale Effect Animation
Hero image with interactive tap-to-zoom spring animation.
ImageWithScaleEffectAnimation.swiftPro
import SwiftUI
// Download the image here: https://drive.google.com/file/d/1zxSawoJvXA333ihnknEB2wwuDiwv2d-u/view?usp=sharing
struct ImageWScaleEffectAnimation: View {
@State private var isAnimating: Bool = false
// ...
// Complete source code available in Compot Pro on the App Store.Compot Pro Component
Unlock full code & interactive preview
Interactive live preview and complete SwiftUI code available in the Compot App.
Available for macOS & iOS • 85+ free components included
Explore other SwiftUI categories
Buttons (34)Texts & Typography (18)Banners & Promos (10)Cards & Content Displays (8)Settings, Lists & Rows (9)Avatars & User Profiles (7)Charts & Gauges (5)Icons & Badges (7)Links & Sharing (5)Navigation Links & Banners (3)Onboarding & Welcome Screens (3)Paywalls & Subscriptions (3)Labels (4)SF Symbols & Animations (4)Inputs & Text Editors (2)Shapes, Chat & Real-Time (2)Tiles & Selectables (2)Badges & Pills (1)Alerts & Modals (1)Toasts & Feedback (1)Developer Templates & Architecture (3)