Skip to content
Unread Dots preview
Rendered from the SwiftUI source on this page.

Unread Dots

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

Icons with unread indicator dots.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

NotificationDots.swift
// Unread Dots · syxUI · https://syxui.dev/components/tag-notification-dots
// 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)

// Notification dots
struct NotificationDots: View {
    var body: some View {
        HStack(spacing: 24) {
            ForEach(Array([("house.fill", true), ("heart.fill", false), ("person.fill", true)].enumerated()), id: \.offset) { _, b in
                Image(systemName: b.0).font(.system(size: 24)).foregroundStyle(.primary).overlay(alignment: .topTrailing) { if b.1 { Circle().fill(tgRed).frame(width: 10, height: 10).overlay(Circle().stroke(Color(.systemBackground), lineWidth: 2)).offset(x: 4, y: -3) } }
            }
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17