Skip to content
Presence Status preview
Rendered from the SwiftUI source on this page.

Presence Status

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

Online / away / offline dot pills.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

DotStatus.swift
// Presence Status · syxUI · https://syxui.dev/components/tag-dot-status
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let tgGreen = Color(red: 0.16, green: 0.66, blue: 0.40)
let tgOrange = Color(red: 0.98, green: 0.55, blue: 0.10)
let tgGray = Color(red: 0.55, green: 0.56, blue: 0.60)

func dotPill(_ text: String, _ color: Color) -> some View {
    HStack(spacing: 6) { Circle().fill(color).frame(width: 7, height: 7); Text(text).font(.system(size: 13, weight: .medium)) }.padding(.horizontal, 11).padding(.vertical, 6).background(Color.primary.opacity(0.05), in: Capsule())
}

struct DotStatus: View { var body: some View { HStack(spacing: 8) { dotPill("Online", tgGreen); dotPill("Away", tgOrange); dotPill("Offline", tgGray) } } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17