Skip to content
Account Row preview
Rendered from the SwiftUI source on this page.

Account Row

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

An account row with avatar, name and chevron.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

AccountRow.swift
// Account Row · syxUI · https://syxui.dev/components/list-account
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

extension View {
    func formaCard(_ pad: CGFloat = 18) -> some View {
        self.padding(pad)
            .background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
            .overlay(RoundedRectangle(cornerRadius: 20, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1))
            .shadow(color: .black.opacity(0.05), radius: 14, x: 0, y: 6)
    }
}

// Account row
struct AccountRow: View {
    var body: some View {
        HStack(spacing: 12) {
            Image("person_5").resizable().scaledToFill().frame(width: 56, height: 56).clipShape(Circle())
            VStack(alignment: .leading, spacing: 2) { Text("Sarah Miller").font(.system(size: 17, weight: .semibold)); Text("Apple Account, iCloud & more").font(.system(size: 13)).foregroundStyle(.secondary) }
            Spacer()
            Image(systemName: "chevron.right").font(.system(size: 13, weight: .semibold)).foregroundStyle(.secondary.opacity(0.5))
        }.formaCard(14).frame(width: 330)
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_5 (image asset)

Requires iOS 17