Skip to content
Event Card preview
Rendered from the SwiftUI source on this page.

Event Card

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

An event card with a date badge, location and attendee avatars.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

EventCard.swift
// Event Card · syxUI · https://syxui.dev/components/card-event
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

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

// Event card
struct EventCard: View {
    let accent = Color(red: 0.35, green: 0.34, blue: 0.84)
    var body: some View {
        HStack(spacing: 14) {
            VStack(spacing: 0) {
                Text("JUL").font(.system(size: 12, weight: .bold)).foregroundStyle(accent)
                Text("24").font(.system(size: 22, weight: .bold))
            }
            .frame(width: 56, height: 56).background(accent.opacity(0.10), in: RoundedRectangle(cornerRadius: 12, style: .continuous))
            VStack(alignment: .leading, spacing: 4) {
                Text("Design Meetup 2026").font(.system(size: 16, weight: .semibold))
                Label("Moscone Center, SF", systemImage: "mappin").font(.system(size: 13)).foregroundStyle(.secondary)
                HStack(spacing: -8) {
                    ForEach(["person_2", "person_3", "person_4"], id: \.self) { p in
                        Image(p).resizable().scaledToFill().frame(width: 22, height: 22).clipShape(Circle()).overlay(Circle().stroke(Color(.systemBackground), lineWidth: 1.5))
                    }
                    Text("+42 going").font(.system(size: 12)).foregroundStyle(.secondary).padding(.leading, 12)
                }
            }
            Spacer(minLength: 0)
        }.formaCard(14).frame(width: 320)
    }
}
iOS 17 · 3 dependencies

Dependencies

SwiftUI
  • person_2 (image asset)
  • person_3 (image asset)
  • person_4 (image asset)

Requires iOS 17