Repository Public MIT
1{2 "accessibility" : [3 "Title and description form the label of the toggle, so VoiceOver reads both, then the state.",4 "The symbol is hidden from assistive technologies.",5 "Title and description wrap at large text sizes; nothing is truncated.",6 "The state is the position of the switch (and, with the system setting, its on/off labels), not the tint alone."7 ],8 "category" : "selection",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-foundation",21 "version" : "1.0.0"22 }23 ],24 "description" : "System toggle with title, description and disabled state.",25 "examples" : [26 {27 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassToggleExample: GlassExample {\n public static let componentID = \"glass-toggle\"\n @State private var notifications = true\n @State private var summary = false\n @State private var analytics = false\n @State private var terms = false\n\n public init() {}\n\n public var body: some View {\n ScrollView {\n VStack(alignment: .leading, spacing: 20) {\n GlassToggle(\"Notifications\", isOn: $notifications)\n GlassToggle(\n \"Weekly summary\",\n description: \"A digest every Monday morning with the activity of the previous week, sent to the address of your account.\",\n systemImage: \"envelope\",\n isOn: $summary\n )\n GlassToggle(\"Share usage statistics\", description: \"Managed by your organisation.\", isOn: $analytics)\n .disabled(true)\n GlassToggle(\"I accept the terms\", appearance: .checkbox, isOn: $terms)\n }\n .padding()\n }\n }\n}\n\n#Preview(\"GlassToggle\") { GlassToggleExample().glassTheme(.emerald) }\n",28 "title" : "GlassToggle example"29 }30 ],31 "files" : [32 {33 "bytes" : 5118,34 "path" : "Forms/Selection/GlassToggle.swift",35 "sha256" : "a34c5fa75f5f23429d0ff41d06987d8db292cfefd94be3856836b048fc66e418"36 }37 ],38 "frameworks" : [3940 ],41 "id" : "glass-toggle",42 "kind" : "native-wrapper",43 "license" : "MIT",44 "minimumOS" : {45 "iOS" : "26.0",46 "iPadOS" : "26.0",47 "macOS" : "26.0"48 },49 "name" : "GlassToggle",50 "platforms" : [51 "iOS",52 "iPadOS",53 "macOS"54 ],55 "schemaVersion" : 1,56 "sha256" : "a2fd4e63902ae61ce790249d098a1880773868da352fbff01efa6197337e102c",57 "symbols" : [58 "GlassToggleAppearance",59 "GlassToggle"60 ],61 "version" : "1.0.0"62}63