Repository Public MIT
1{2 "accessibility" : [3 "A tappable card is a single `Button`: VoiceOver reads its texts as one element with the button trait.",4 "A static card is a container; its header carries the header trait, so rotor navigation by headings works.",5 "Text uses theme fonts and wraps; the card grows with Dynamic Type."6 ],7 "category" : "containers",8 "changelog" : [9 {10 "changes" : [11 "Release 1.1.0: see the project changelog."12 ],13 "date" : "2026-12-03",14 "version" : "1.1.0"15 },16 {17 "changes" : [18 "Initial release."19 ],20 "date" : "2026-12-02",21 "version" : "1.0.0"22 }23 ],24 "dependencies" : [25 {26 "id" : "glass-foundation",27 "version" : "1.1.0"28 }29 ],30 "description" : "Content container: opaque for dense content, glass when it floats above other content.",31 "examples" : [32 {33 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassCardExample: GlassExample {\n public static let componentID = \"glass-card\"\n @State private var openCount = 0\n\n public init() {}\n\n public var body: some View {\n ScrollView {\n VStack(alignment: .leading, spacing: 16) {\n GlassCard(\"Monthly rent\") {\n Text(\"1,450 $\").font(.title2)\n Text(\"Sample listing · 4½ · Plateau\").foregroundStyle(.secondary)\n }\n GlassCard {\n Text(\"A long description wraps on several lines and stays readable because the card is opaque: dense text never sits on glass.\")\n } header: {\n Label(\"About this place\", systemImage: \"text.alignleft\")\n } footer: {\n Text(\"Fictitious data\")\n }\n GlassCard {\n // Any view: a photo, a map, a drawing. Give it a height.\n Rectangle().fill(.tint.opacity(0.25)).frame(height: 120)\n .overlay { Image(systemName: \"building.2\").font(.largeTitle).foregroundStyle(.tint) }\n .accessibilityHidden(true)\n } content: {\n Text(\"Two bedrooms · 74 m² · Balcony\").foregroundStyle(.secondary)\n } header: {\n Text(\"Loft on the canal\")\n } footer: {\n Label(\"Available 1 July\", systemImage: \"calendar\")\n }\n GlassCard(style: .floating, action: { openCount += 1 }) {\n Label(\"3 listings nearby\", systemImage: \"mappin.and.ellipse\")\n Text(\"Opened \\(openCount) times\").font(.caption)\n }\n .accessibilityHint(\"Opens the list\")\n }\n .padding()\n }\n }\n}\n\n#Preview(\"GlassCard\") { GlassCardExample().glassTheme(.ocean) }\n",34 "title" : "GlassCard example"35 }36 ],37 "files" : [38 {39 "bytes" : 9958,40 "path" : "Components/Containers/GlassCard.swift",41 "sha256" : "378dce583235c733fe2b017a93fbaaf5da35cf1f9abe7609b0e4c655b63af3a4"42 }43 ],44 "frameworks" : [4546 ],47 "id" : "glass-card",48 "kind" : "content-component",49 "license" : "MIT",50 "minimumOS" : {51 "iOS" : "26.0",52 "iPadOS" : "26.0",53 "macOS" : "26.0"54 },55 "name" : "GlassCard",56 "platforms" : [57 "iOS",58 "iPadOS",59 "macOS"60 ],61 "schemaVersion" : 1,62 "sha256" : "292a9cd06620f2426bbe37a51140985b1fe261b6c2fefc4203eb2bbe0b5b118b",63 "symbols" : [64 "GlassCardStyle",65 "GlassCard"66 ],67 "version" : "1.1.0"68}69