Skip to content
Share Buttons preview
Rendered from the SwiftUI source on this page.

Share Buttons

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

A row of colored social-share buttons.

Buttons · SwiftUI · iOS 17

  • buttons
  • swiftui

The actual source

ShareButtonCard.swift
// Share Buttons · syxUI · https://syxui.dev/components/btn-share
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Social share row
struct ShareButtonCard: View {
    let items: [(String, Color)] = [("message.fill", Color(red: 0.2, green: 0.78, blue: 0.35)), ("envelope.fill", Color(red: 0.0, green: 0.47, blue: 1.0)), ("link", Color.gray), ("square.and.arrow.up", Color(red: 0.0, green: 0.47, blue: 1.0))]
    var body: some View {
        HStack(spacing: 16) {
            ForEach(Array(items.enumerated()), id: \.offset) { _, it in
                Image(systemName: it.0).font(.system(size: 18)).foregroundStyle(.white).frame(width: 48, height: 48).background(it.1, in: Circle())
            }
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17