Skip to content
Message Reactions preview
Rendered from the SwiftUI source on this page.

Message Reactions

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

A bubble with an emoji reaction pill tucked into its corner.

Chat · SwiftUI · iOS 17

  • chat
  • swiftui

The actual source

ChatReactions.swift
// Message Reactions · syxUI · https://syxui.dev/components/chat-reactions
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Message with emoji reactions
struct ChatReactions: View {
    var body: some View {
        HStack {
            Text("This is amazing work!")
                .font(.system(size: 16)).foregroundStyle(.primary)
                .padding(.horizontal, 14).padding(.vertical, 10)
                .background(Color(.systemGray5), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
                .overlay(alignment: .bottomTrailing) {
                    HStack(spacing: 3) {
                        Image(systemName: "heart.fill").font(.system(size: 11)).foregroundStyle(.red)
                        Image(systemName: "hand.thumbsup.fill").font(.system(size: 11)).foregroundStyle(Color(red: 0.0, green: 0.47, blue: 1.0))
                        Text("3").font(.system(size: 12, weight: .semibold)).foregroundStyle(.secondary)
                    }
                    .padding(.horizontal, 7).padding(.vertical, 4)
                    .background(Color(.systemBackground), in: Capsule())
                    .overlay(Capsule().stroke(Color.primary.opacity(0.08), lineWidth: 1))
                    .offset(x: 12, y: 14)
                }
            Spacer(minLength: 44)
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17