Skip to content
Achievement Badges preview
Rendered from the SwiftUI source on this page.

Achievement Badges

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

Trophy and medal badges.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

AchievementBadges.swift
// Achievement Badges · syxUI · https://syxui.dev/components/tag-achievement
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let tgGray = Color(red: 0.55, green: 0.56, blue: 0.60)

// Achievement badges
struct AchievementBadges: View {
    var body: some View {
        HStack(spacing: 16) {
            ForEach(Array([("trophy.fill", Color(red: 0.98, green: 0.72, blue: 0.10)), ("medal.fill", tgGray), ("star.circle.fill", Color(red: 0.80, green: 0.50, blue: 0.20))].enumerated()), id: \.offset) { _, b in
                Image(systemName: b.0).font(.system(size: 26)).foregroundStyle(.white).frame(width: 52, height: 52).background(LinearGradient(colors: [b.1, b.1.opacity(0.7)], startPoint: .top, endPoint: .bottom), in: Circle()).shadow(color: b.1.opacity(0.4), radius: 6, y: 3)
            }
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17