Skip to content
Live Avatar preview
Rendered from the SwiftUI source on this page.

Live Avatar

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

An avatar with a LIVE ring and label.

Avatars · SwiftUI · iOS 17

  • avatars
  • swiftui

The actual source

AvatarLive.swift
// Live Avatar · syxUI · https://syxui.dev/components/avatar-live
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let avRed = Color(red: 0.90, green: 0.24, blue: 0.28)

func av(_ name: String, _ d: CGFloat) -> some View { Image(name).resizable().scaledToFill().frame(width: d, height: d).clipShape(Circle()) }

struct AvatarLive: View { var body: some View { av("person_3", 64).padding(3).overlay(Circle().stroke(avRed, lineWidth: 2.5)).overlay(alignment: .bottom) { Text("LIVE").font(.system(size: 9, weight: .bold)).foregroundStyle(.white).padding(.horizontal, 6).padding(.vertical, 2).background(avRed, in: Capsule()).offset(y: 6) } } }
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_3 (image asset)

Requires iOS 17