Skip to content
Profile Header preview
Rendered from the SwiftUI source on this page.

Profile Header

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

A profile header - avatar, name, role and inline follower stats.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

HeaderProfile.swift
// Profile Header · syxUI · https://syxui.dev/components/hdr-profile
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Profile header - avatar, handle, inline stats, edit
struct HeaderProfile: View {
    var body: some View {
        VStack(spacing: 14) {
            HStack(spacing: 14) {
                Image("person_1").resizable().scaledToFill().frame(width: 68, height: 68).clipShape(Circle())
                VStack(alignment: .leading, spacing: 3) {
                    Text("Amara Kelly").font(.system(size: 20, weight: .bold))
                    Text("Product Designer · SF").font(.system(size: 13)).foregroundStyle(.secondary)
                }
                Spacer()
            }
            HStack(spacing: 0) {
                ForEach([("248", "Posts"), ("12.4k", "Followers"), ("380", "Following")], id: \.0) { v, l in
                    VStack(spacing: 2) {
                        Text(v).font(.system(size: 17, weight: .bold))
                        Text(l).font(.system(size: 12)).foregroundStyle(.secondary)
                    }.frame(maxWidth: .infinity)
                }
            }
        }.frame(width: 340)
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_1 (image asset)

Requires iOS 17