Skip to content
Priority Tags preview
Rendered from the SwiftUI source on this page.

Priority Tags

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

Dot-prefixed priority pills.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

PriorityTags.swift
// Priority Tags · syxUI · https://syxui.dev/components/tag-priority
// 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 tgRed = Color(red: 0.90, green: 0.24, blue: 0.28)

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 PriorityTags: View { var body: some View { HStack(spacing: 8) { dotPill("High", tgRed); dotPill("Medium", tgOrange); dotPill("Low", tgGreen) } } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17