Repository Public MIT
1{2 "accessibility" : [3 "A count is read as \"7 items\", or \"More than 99\" above the cap; replace it with `.accessibilityLabel` when the unit matters (\"7 unread messages\").",4 "A status badge is read by its label; the symbol is hidden from VoiceOver. With `showsLabel: false` the label remains the accessibility label and the symbol shape still identifies the tone.",5 "Text on a coloured fill uses `theme.onColor`, the more legible of white and near-black for that fill. Digits follow the locale.",6 "The caption font follows Dynamic Type."7 ],8 "category" : "feedback",9 "changelog" : [10 {11 "changes" : [12 "Initial release."13 ],14 "date" : "2026-12-02",15 "version" : "1.0.0"16 }17 ],18 "dependencies" : [19 {20 "id" : "glass-components-support",21 "version" : "1.0.0"22 },23 {24 "id" : "glass-forms-support",25 "version" : "1.0.0"26 },27 {28 "id" : "glass-foundation",29 "version" : "1.0.0"30 }31 ],32 "description" : "Count, value or status marker that never relies on colour alone.",33 "examples" : [34 {35 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassBadgeExample: GlassExample {\n public static let componentID = \"glass-badge\"\n @State private var unread = 7\n\n public init() {}\n\n public var body: some View {\n VStack(alignment: .leading, spacing: 16) {\n HStack(spacing: 12) {\n Text(\"Inbox\")\n GlassBadge(count: unread)\n Spacer()\n Stepper(\"Unread\", value: $unread, in: -1...150, step: 31).labelsHidden()\n }\n HStack(spacing: 12) {\n GlassBadge(\"New\", tone: .accent)\n GlassBadge(\"Beta\")\n GlassBadge(\"−12 %\", tone: .critical)\n GlassBadge(count: 0, showsZero: true, tone: .neutral)\n }\n VStack(alignment: .leading, spacing: 8) {\n GlassBadge(status: \"Online\", tone: .success)\n GlassBadge(status: \"Degraded\", tone: .warning)\n GlassBadge(status: \"Offline\", tone: .critical)\n GlassBadge(status: \"Unknown\", tone: .neutral)\n }\n }\n .padding()\n }\n}\n\n#Preview(\"GlassBadge\") { GlassBadgeExample().glassTheme(.aurora) }\n",36 "title" : "GlassBadge example"37 }38 ],39 "files" : [40 {41 "bytes" : 7469,42 "path" : "Components/Feedback/GlassBadge.swift",43 "sha256" : "1e68ae9091bdcbbda2b6044c11d4c50d4a03fc878f0874136d43beb7426a1014"44 }45 ],46 "frameworks" : [4748 ],49 "id" : "glass-badge",50 "kind" : "content-component",51 "license" : "MIT",52 "minimumOS" : {53 "iOS" : "26.0",54 "iPadOS" : "26.0",55 "macOS" : "26.0"56 },57 "name" : "GlassBadge",58 "platforms" : [59 "iOS",60 "iPadOS",61 "macOS"62 ],63 "schemaVersion" : 1,64 "sha256" : "ce83f1e7b297c94cdc4d413a3a08b424b270007014fbc4ff9686878d8b1ea77f",65 "symbols" : [66 "GlassBadgeTone",67 "GlassBadgeFormatter",68 "GlassBadge"69 ],70 "version" : "1.0.0"71}72