User Profile Card

User Profile Card

by dockui

Reusable SwiftUI profile card component featuring profile image, verification badge, bio text, follower stats, and a follow action

Platform
SwiftUI
Code
Native Swift
Format
Component
Access
Free

Code Snippet

import SwiftUI

struct UserProfileCardView: View {
    var body: some View {
        VStack(spacing: 0) {
            // Profile Image Section
            profileImageSection
            
            // User Information Section
            userInfoSection
            
            // Engagement Metrics and Follow Button
            engagementSection
        }
        .padding(20)
        .background(Color.white)
        .clipShape(RoundedRectangle(cornerRadius: 20))
        .shadow(color: Color.black.opacity(0.1), radius: 10, x: 0, y: 5)
    }
    
    private var profileImageSection: some View {
        Image("profile1")
            .resizable()
            .aspectRatio(contentMode: .fill)
            .frame(width: 120, height: 120)
            .clipShape(RoundedRectangle(cornerRadius: 16))
            .padding(.bottom, 16)
    }
    
    private var userInfoSection: some View {
        VStack(spacing: 8) {
            // Name with Verification Badge
            HStack(spacing: 8) {
                Text("Maicol")
                    .font(.system(size: 24, weight: .bold))
                    .foregroundColor(.black)
                
                // Verification Badge
                Image(systemName: "checkmark.seal.fill")
                    .font(.system(size: 18))
                    .foregroundColor(.blue)
            }
            
            // Bio
            Text("SwiftUI developer that focuses on making good apps.")
                .font(.system(size: 14, weight: .regular))
                .foregroundColor(.gray)
                .multilineTextAlignment(.center)
                .lineLimit(2)
                .padding(.horizontal, 8)
        }
        .padding(.bottom, 20)
    }
    
    private var engagementSection: some View {
        HStack(spacing: 24) {
            // Follower Count
            HStack(spacing: 6) {
                Image(systemName: "person.fill")
                    .font(.system(size: 14))
                    .foregroundColor(.black)
                Text("35K")
                    .font(.system(size: 14, weight: .medium))
                    .foregroundColor(.black)
            }
            
            // Post/Activity Count
            HStack(spacing: 6) {
                Image(systemName: "heart.fill")
                    .font(.system(size: 14))
                    .foregroundColor(.black)
                Text("2.34M")
                    .font(.system(size: 14, weight: .medium))
                    .foregroundColor(.black)
            }
            
            Spacer()
            
            // Follow Button
            Button(action: {}) {
                HStack(spacing: 4) {
                    Text("Follow")
                        .font(.system(size: 14, weight: .medium))
                        .foregroundColor(.black)
                    Image(systemName: "plus")
                        .font(.system(size: 12, weight: .semibold))
                        .foregroundColor(.black)
                }
                .padding(.horizontal, 16)
                .padding(.vertical, 8)
                .background(Color.gray.opacity(0.15))
                .clipShape(RoundedRectangle(cornerRadius: 12))
            }
        }
    }
}

More Templates

Similar Blogs

View All Articles
How to Translate Xcode String Catalogs with AI

How to Translate Xcode String Catalogs with AI

Learn how to efficiently translate Xcode string catalogs using AI fast, streamlining localization for your iOS and SwiftUI applications.

by dockui
May 4
How to optimize your SwiftUI app in 2026

How to optimize your SwiftUI app in 2026

Discover top strategies to optimize your SwiftUI app in 2026, enhancing performance, responsiveness, and maintainability with modern concurrency.

by dockui
Apr 29
SwiftUI: iOS Confirmation Alert (Confirm + Cancel)

SwiftUI: iOS Confirmation Alert (Confirm + Cancel)

SwiftUI iOS confirmation alert with Confirm and Cancel buttons. Beginners guide to building safe actions, destructive deletes, and commit dialogs.

by dockui
Nov 11
SwiftUI: IOS Haptic Feedback Guide 2026

SwiftUI: IOS Haptic Feedback Guide 2026

Add click to vibrate haptic feedback in SwiftUI. Full guide to UIImpactFeedbackgenerator, success, error, selection, and tap vibration patterns with code.

by dockui
Nov 11

Code copied to clipboard!