Skip to content
Contact Actions preview
Rendered from the SwiftUI source on this page.

Contact Actions

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

A contact row with call and message buttons.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

ContactActionRow.swift
// Contact Actions · syxUI · https://syxui.dev/components/list-contact-action
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let listBlue = Color(red: 0.0, green: 0.47, blue: 1.0)
let listGreen = Color(red: 0.20, green: 0.78, blue: 0.35)

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)
    }
}

// Contact row with actions
struct ContactActionRow: View {
    var body: some View {
        HStack(spacing: 12) {
            Image("person_2").resizable().scaledToFill().frame(width: 48, height: 48).clipShape(Circle())
            VStack(alignment: .leading, spacing: 2) { Text("James Wilson").font(.system(size: 16, weight: .medium)); Text("+1 (415) 555-0129").font(.system(size: 13)).foregroundStyle(.secondary) }
            Spacer()
            Image(systemName: "phone.fill").font(.system(size: 15)).foregroundStyle(listGreen).frame(width: 36, height: 36).background(listGreen.opacity(0.12), in: Circle())
            Image(systemName: "message.fill").font(.system(size: 15)).foregroundStyle(listBlue).frame(width: 36, height: 36).background(listBlue.opacity(0.12), in: Circle())
        }.formaCard(14).frame(width: 340)
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_2 (image asset)

Requires iOS 17