Skip to content
Live Badge preview
Rendered from the SwiftUI source on this page.

Live Badge

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

A live + viewer-count badge.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

LiveBadge.swift
// Live Badge · syxUI · https://syxui.dev/components/tag-live
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let tgRed = Color(red: 0.90, green: 0.24, blue: 0.28)

// Live badge
struct LiveBadge: View {
    var body: some View {
        HStack(spacing: 10) {
            HStack(spacing: 5) { Circle().fill(.white).frame(width: 6, height: 6); Text("LIVE").font(.system(size: 12, weight: .bold)).foregroundStyle(.white) }.padding(.horizontal, 9).padding(.vertical, 5).background(tgRed, in: Capsule())
            HStack(spacing: 5) { Image(systemName: "eye.fill").font(.system(size: 10)); Text("2.4K").font(.system(size: 13, weight: .semibold)) }.foregroundStyle(.secondary).padding(.horizontal, 9).padding(.vertical, 5).background(Color.primary.opacity(0.05), in: Capsule())
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17