
Avatar Tile
From syxUI — written for both platforms, not translated between them.
An avatar card with name and role.
Avatars · SwiftUI · iOS 17
- avatars
- swiftui
The actual source
AvatarTile.swift
// Avatar Tile · syxUI · https://syxui.dev/components/avatar-tile
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
func av(_ name: String, _ d: CGFloat) -> some View { Image(name).resizable().scaledToFill().frame(width: d, height: d).clipShape(Circle()) }
struct AvatarTile: View { var body: some View { VStack(spacing: 10) { av("person_4", 64); VStack(spacing: 2) { Text("Arjun Patel").font(.system(size: 15, weight: .semibold)); Text("Engineer").font(.system(size: 12)).foregroundStyle(.secondary) } }.padding(16).frame(width: 150).background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 16, style: .continuous)).overlay(RoundedRectangle(cornerRadius: 16, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1)).shadow(color: .black.opacity(0.05), radius: 12, y: 4) } }
iOS 17 · 1 dependencies
Dependencies
- SwiftUI
- person_4 (image asset)
Requires iOS 17