Autumn Sale50% offCOMPOT

SwiftUI Icons & Badges

Settings icon containers, gradient badges, stroke containers, and pixel-perfect App Icon frames. (7 components available in Compot).

1 of 7Free ComponentiOS 16.0+

Icon with Background

Square rounded icon with solid background color for settings menus.

View Component & Details
IconWithBackground.swift
import SwiftUI

struct IconWithBackground: View {
    var body: some View {
        Image(systemName: "bell.badge.fill")
        .foregroundStyle(.white)
        .frame(width: 28, height: 28, alignment: .center)
        .background(.red, in: RoundedRectangle(cornerRadius: 7, style: .continuous))
    }
}

#Preview {
    IconWithBackground()
}
2 of 7Pro ComponentiOS 16.0+

Icon with Gradient Background

SF Symbol on top of a smooth linear gradient background.

View Component & Details
IconWithGradientBackground.swift
Unlock in App
import SwiftUI

struct LabelIconWBackgroundGradient: View {
    
    let symbol: String
    let fgColor: Color
    let bgColor: Color
    

        // ...
        // 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

3 of 7Pro ComponentiOS 16.0+

Icon with Stroke

SF Symbol enclosed in a colored border stroke container.

View Component & Details
IconWithStroke.swift
Unlock in App
import SwiftUI

struct UseLabelIconWStroke: View {
    
    var body: some View {
        Label {
            Text("Scheme")
        } icon: {

        // ...
        // 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

4 of 7Free ComponentiOS 16.0+

App Icon 60x60

Pixel-perfect 60x60 app icon showcase container.

View Component & Details
AppIcon60x60.swift
import SwiftUI

struct AppIcon60x60: View {
    var body: some View {
        RoundedRectangle(cornerRadius: 15, style: .continuous)
        .frame(width: 60, height: 60)
        .foregroundStyle(.green.gradient)
        .overlay {
            Image(systemName: "message.fill")
            .resizable()
            .foregroundStyle(.white)
            .frame(width: 40, height: 40)
        }
    }
}

#Preview {
    AppIcon60x60()
}
5 of 7Free ComponentiOS 16.0+

App Icon 75x75 using AppIcon

Dynamically loaded main application icon container with standard iOS corner radius.

View Component & Details
AppIcon75x75UsingAppicon.swift
import SwiftUI

// Place image named "AppIcon" into Assets in your XCode project
enum AppIconProvider {
    static func appIcon(in bundle: Bundle = .main) -> String? {
        guard let icons = bundle.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any],
              let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any],
              let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String],
              let iconFileName = iconFiles.last else {
            return nil
        }
        return iconFileName
    }
}

struct AppIcon: View {
    
    let appIcon: String
    
    var body: some View {
        if let appIcon = UIImage(named: appIcon) {
            Image(uiImage: appIcon)
                .resizable()
                .aspectRatio(contentMode: .fit)
                .clipShape(RoundedRectangle(cornerRadius: 15, style: .continuous))
        } else {
            // Fallback icon or placeholder
            Image(systemName: "app.fill")
                .resizable()
                .aspectRatio(contentMode: .fit)
                .foregroundColor(.accentColor)
                .clipShape(RoundedRectangle(cornerRadius: 15, style: .continuous))
        }
    }
}

struct AppIcon75UsingAppIcon: View {
    var body: some View {
        VStack {
            AppIcon(appIcon: AppIconProvider.appIcon() ?? "AppIcon")
        }
        .frame(width: 75, height: 75)
        .shadow(color: .gray.opacity(0.4), radius: 4)
    }
}

#Preview {
    AppIcon75UsingAppIcon()
}
6 of 7Free ComponentiOS 16.0+

Badge with Symbol & Palette Rendering

Notification badge utilizing SF Symbol multi-tone palette colors.

View Component & Details
BadgeWithSymbolPaletteRendering.swift
import SwiftUI

struct UseBadgeWSymbolPaletteRendering: View {
    
    var body: some View {
        HStack {
            BadgeWSymbolPaletteRendering(title: "Weather", symbol: "cloud.sun.rain.fill", firstColor: .white, secondColor: .yellow, thirdColor: .blue)
        }
    }
}

#Preview {
    UseBadgeWSymbolPaletteRendering()
}

struct BadgeWSymbolPaletteRendering: View {
    
    var title: String
    var symbol: String
    var firstColor: Color
    var secondColor: Color
    var thirdColor: Color
    
    var body: some View {
        HStack(alignment: .center, spacing: 8) {
            Image(systemName: symbol)
                .font(.system(size: 20, weight: .regular))
                .symbolRenderingMode(.palette)
                .foregroundStyle(firstColor, secondColor, thirdColor)
            Text(title)
                .foregroundStyle(.primary)
        }
        .font(.system(size: 15, weight: .medium))
        .padding(.vertical, 8)
        .padding(.horizontal, 12)
        .background(.thinMaterial, in: RoundedRectangle(cornerRadius: 12.0, style: .continuous))
    }
}

More SwiftUI Icons & Badges Components (1)

Browse additional icons & badges components from our library. Click through to view standalone source code and usage examples.