SwiftUI Shapes, Chat & Real-Time
Dynamic chat message speech bubbles and pulsing 3-dot typing indicators. (2 components available in Compot).
1 of 2Pro ComponentiOS 16.0+
Message Bubble Basic
Chat speech bubble with tail shape, dynamic color by sender, and timestamp.
MessageBubbleBasic.swiftPro
import SwiftUI
struct UseMessageBubbleBasic: View {
var body: some View {
VStack {
MessageBubbleBasic(msgDateTime: Date.now, msgText: "Ahoy, know Compot?", isMsgFromUser: false)
MessageBubbleBasic(msgDateTime: Date.now, msgText: "Yeah, crazy, right! What's your favorite component?", isMsgFromUser: true)
// ...
// Complete source code available in Compot Pro on the App Store.Compot Pro Component
Unlock full code & interactive preview
Interactive live preview and complete SwiftUI code available in the Compot App.
Available for macOS & iOS • 85+ free components included
2 of 2Free ComponentiOS 16.0+
Typing Indicator
Animated 3-dot pulsing typing indicator for chat and AI conversations.
TypingIndicator.swift
import SwiftUI
struct TypingIndicator: View {
let delay: Double = 0.3
@State private var isAnimating = false
let pointSize: CGFloat = 10
let pointSpacing: CGFloat = 4
let accentColor: Color = .blue
var body: some View {
HStack(spacing: pointSpacing) {
ForEach(0..<3) { index in
Circle()
.frame(width: pointSize, height: pointSize)
.foregroundStyle(accentColor)
.scaleEffect(isAnimating ? 1 : 0.6)
.animation(.easeInOut(duration: 0.6).repeatForever(autoreverses: true).delay(delay * Double(index)), value: isAnimating)
}
}
.padding()
.background(accentColor.opacity(0.3), in: Capsule())
.onAppear {
isAnimating = true
}
}
}
#Preview {
TypingIndicator()
}Explore other SwiftUI categories
Buttons (34)Texts & Typography (18)Banners & Promos (10)Cards & Content Displays (8)Settings, Lists & Rows (9)Avatars & User Profiles (7)Charts & Gauges (5)Icons & Badges (7)Links & Sharing (5)Navigation Links & Banners (3)Onboarding & Welcome Screens (3)Paywalls & Subscriptions (3)Images & Effects (3)Labels (4)SF Symbols & Animations (4)Inputs & Text Editors (2)Tiles & Selectables (2)Badges & Pills (1)Alerts & Modals (1)Toasts & Feedback (1)Developer Templates & Architecture (3)