SPB Git

Repository Public MIT

manifest.json 3.2 KB 63 lines json

1{2  "accessibility" : [3    "Both presentations are system pickers: label, selected value and keyboard navigation come from the system.",4    "The title is always set, although segmented pickers do not display it.",5    "At accessibility text sizes the menu keeps every title readable in full."6  ],7  "category" : "selection",8  "changelog" : [9    {10      "changes" : [11        "Initial release."12      ],13      "date" : "2026-12-02",14      "version" : "1.0.0"15    }16  ],17  "dependencies" : [18    {19      "id" : "glass-foundation",20      "version" : "1.0.0"21    }22  ],23  "description" : "Segmented picker with labels that adapt to the available width.",24  "examples" : [25    {26      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassSegmentedControlExample: GlassExample {\n    public static let componentID = \"glass-segmented-control\"\n\n    enum Mode: String, CaseIterable, Hashable {\n        case list, grid, map\n\n        var title: String { rawValue.capitalized }\n    }\n\n    @State private var mode = Mode.list\n    @State private var period = \"Week\"\n    @State private var long = \"Everything that happened\"\n    @State private var weekday = \"Mon\"\n\n    public init() {}\n\n    public var body: some View {\n        ScrollView {\n            VStack(alignment: .leading, spacing: 24) {\n                GlassSegmentedControl(\"View\", selection: $mode, options: Mode.allCases, title: \\.title)\n                Text(\"Showing: \\(mode.title)\").font(.callout).foregroundStyle(.secondary)\n\n                GlassSegmentedControl(\"Period\", selection: $period, options: [\"Day\", \"Week\", \"Month\", \"Year\"]) { $0 }\n\n                Text(\"Titles too long for the width fall back to a menu\").font(.headline)\n                GlassSegmentedControl(\"Scope\", selection: $long, options: [\"Everything that happened\", \"Only what I was mentioned in\", \"Nothing at all, thank you\"]) { $0 }\n\n                Text(\"More than five options: a menu\").font(.headline)\n                GlassSegmentedControl(\"Day\", selection: $weekday, options: [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"]) { $0 }\n\n                GlassSegmentedControl(\"Locked\", selection: .constant(\"On\"), options: [\"Off\", \"On\"]) { $0 }\n                    .disabled(true)\n            }\n            .frame(maxWidth: .infinity, alignment: .leading)\n            .padding()\n        }\n    }\n}\n\n#Preview(\"GlassSegmentedControl\") { GlassSegmentedControlExample() }\n",27      "title" : "GlassSegmentedControl example"28    }29  ],30  "files" : [31    {32      "bytes" : 5139,33      "path" : "Forms/Selection/GlassSegmentedControl.swift",34      "sha256" : "73ee49a9034505939d5569ac6b6aea183c2a0c1d66744ed73204bdf4d9c19cfb"35    }36  ],37  "frameworks" : [3839  ],40  "id" : "glass-segmented-control",41  "kind" : "native-wrapper",42  "license" : "MIT",43  "minimumOS" : {44    "iOS" : "26.0",45    "iPadOS" : "26.0",46    "macOS" : "26.0"47  },48  "name" : "GlassSegmentedControl",49  "platforms" : [50    "iOS",51    "iPadOS",52    "macOS"53  ],54  "schemaVersion" : 1,55  "sha256" : "7c7fca593c5c13691858cb62d326b9de159e1ad58ccb5ac4a6b82b2648fc5da8",56  "symbols" : [57    "GlassSegmentedLayout",58    "Presentation",59    "GlassSegmentedControl"60  ],61  "version" : "1.0.0"62}63
Files main
Menu

Theme