Skip to content
Conversation Row preview
Rendered from the SwiftUI source on this page.

Conversation Row

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

A chat-list cell - avatar, name, preview, time and unread badge.

Chat · SwiftUI · iOS 17

  • chat
  • swiftui

The actual source

ChatListRow.swift
// Conversation Row · syxUI · https://syxui.dev/components/chat-list-row
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Conversation list row
struct ChatListRow: View {
    let blue = Color(red: 0.0, green: 0.47, blue: 1.0)
    var body: some View {
        HStack(spacing: 12) {
            Image("person_2").resizable().scaledToFill().frame(width: 52, height: 52).clipShape(Circle())
            VStack(alignment: .leading, spacing: 3) {
                HStack {
                    Text("James Wilson").font(.system(size: 16, weight: .semibold))
                    Spacer()
                    Text("9:41 AM").font(.system(size: 13)).foregroundStyle(.secondary)
                }
                HStack {
                    Text("Sounds great, let's do it! I'll see you…").font(.system(size: 14)).foregroundStyle(.secondary).lineLimit(1)
                    Spacer()
                    Text("2").font(.system(size: 12, weight: .semibold)).foregroundStyle(.white)
                        .frame(minWidth: 20, minHeight: 20).background(blue, in: Circle())
                }
            }
        }
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_2 (image asset)

Requires iOS 17