Skip to content
Number Pills preview
Rendered from the SwiftUI source on this page.

Number Pills

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

Filled counter pills.

Badges · SwiftUI · iOS 17

  • badges
  • swiftui

The actual source

NumberPills.swift
// Number Pills · syxUI · https://syxui.dev/components/tag-number
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let tgBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

// Number / counter pills
struct NumberPills: View {
    var body: some View {
        HStack(spacing: 10) {
            ForEach(["24", "1.2k", "99+"], id: \.self) { n in Text(n).font(.system(size: 13, weight: .bold)).foregroundStyle(.white).frame(minWidth: 26).padding(.horizontal, 8).padding(.vertical, 5).background(tgBlue, in: Capsule()) }
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17