Repository Public MIT
1{2 "accessibility" : [3 "The title is the accessibility label; a custom label must contain text or set `.accessibilityLabel`.",4 "Text follows Dynamic Type and wraps instead of truncating.",5 "The loading state is exposed as an accessibility value, not by the spinner alone.",6 "The destructive role is conveyed by the system role, not only by colour."7 ],8 "category" : "buttons",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-foundation",25 "version" : "1.0.0"26 }27 ],28 "description" : "Button using the system glass styles, with destructive role, loading and disabled states.",29 "examples" : [30 {31 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassButtonExample: GlassExample {\n public static let componentID = \"glass-button\"\n @State private var isSaving = false\n @State private var saveCount = 0\n\n public init() {}\n\n public var body: some View {\n VStack(spacing: 16) {\n GlassButton(\"Save changes\", systemImage: \"checkmark\", variant: .prominent, isLoading: isSaving) {\n isSaving = true\n saveCount += 1\n }\n GlassButton(\"Duplicate\", systemImage: \"plus.square.on.square\") { saveCount += 1 }\n GlassButton(\"Delete draft\", systemImage: \"trash\", role: .destructive) { saveCount = 0 }\n GlassButton(\"Unavailable\", size: .small) {}\n .disabled(true)\n GlassButton(variant: .regular, size: .large) {\n isSaving = false\n } label: {\n VStack {\n Text(\"Reset\")\n Text(\"Saved \\(saveCount) times\").font(.caption)\n }\n }\n }\n .padding()\n }\n}\n\n#Preview(\"GlassButton\") { GlassButtonExample().glassTheme(.aurora) }\n",32 "title" : "GlassButton example"33 }34 ],35 "files" : [36 {37 "bytes" : 5153,38 "path" : "Components/Buttons/GlassButton.swift",39 "sha256" : "6956c52703ac5d305754001bf9eb533b2d7cdf5e4face631a64ee78ec3191786"40 }41 ],42 "frameworks" : [4344 ],45 "id" : "glass-button",46 "kind" : "native-wrapper",47 "license" : "MIT",48 "minimumOS" : {49 "iOS" : "26.0",50 "iPadOS" : "26.0",51 "macOS" : "26.0"52 },53 "name" : "GlassButton",54 "platforms" : [55 "iOS",56 "iPadOS",57 "macOS"58 ],59 "schemaVersion" : 1,60 "sha256" : "2727e2159014165a9b8f26bb7bf193c8ac69b82d78f501c77bb2668a27c27955",61 "symbols" : [62 "GlassButton",63 "GlassButtonLabel"64 ],65 "version" : "1.0.0"66}67