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

Upload Avatar

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

An empty avatar upload dropzone.

Avatars · SwiftUI · iOS 17

  • avatars
  • swiftui

The actual source

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

import SwiftUI

struct AvatarUpload: View { var body: some View { VStack(spacing: 8) { ZStack { Circle().fill(Color.primary.opacity(0.04)).frame(width: 76, height: 76); Circle().stroke(style: StrokeStyle(lineWidth: 1.5, dash: [5, 4])).foregroundStyle(Color.primary.opacity(0.25)).frame(width: 76, height: 76); Image(systemName: "camera.fill").font(.system(size: 22)).foregroundStyle(.secondary) }; Text("Add photo").font(.system(size: 12)).foregroundStyle(.secondary) } } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17