Repository Public MIT
1{2 "accessibility" : [3 "VoiceOver reads the severity word, the title and the message as one element; the symbol is hidden because the word says the same thing.",4 "The action and dismiss buttons are separate elements with labels and the minimum hit target; the action is underlined so that it is recognisable without colour.",5 "Text wraps and follows Dynamic Type; the symbol aligns to the top so long messages stay readable.",6 "For an error that appears while the user is elsewhere on screen, also post an announcement or move focus: the banner does not announce itself."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-foundation",25 "version" : "1.0.0"26 }27 ],28 "description" : "Inline information, success, warning or error message with icon, text and dismissal.",29 "examples" : [30 {31 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassBannerExample: GlassExample {\n public static let componentID = \"glass-banner\"\n @State private var showsWarning = true\n @State private var retryCount = 0\n\n public init() {}\n\n public var body: some View {\n ScrollView {\n VStack(spacing: 12) {\n GlassBanner(.information, title: \"Maintenance on Sunday\", message: \"The sample service will be read-only from 2:00 to 4:00.\")\n GlassBanner(.success, title: \"Payment received\")\n if showsWarning {\n GlassBanner(\n .warning,\n title: \"Your card expires soon\",\n message: \"Update your payment method before the end of the month to avoid an interruption.\",\n action: GlassBannerAction(\"Update card\") { showsWarning = false },\n onDismiss: { showsWarning = false }\n )\n }\n GlassBanner(\n .error,\n verbatim: \"Synchronisation failed (attempt \\(retryCount + 1))\",\n message: \"The server did not answer.\",\n action: GlassBannerAction(\"Retry\") { retryCount += 1 }\n )\n }\n .padding()\n }\n }\n}\n\n#Preview(\"GlassBanner\") { GlassBannerExample().glassTheme(.emerald) }\n",32 "title" : "GlassBanner example"33 }34 ],35 "files" : [36 {37 "bytes" : 7690,38 "path" : "Components/Feedback/GlassBanner.swift",39 "sha256" : "bbeb6cd8c0411b00ef2d6f483322940a46c4aa6a241225de92dbc3c1c3f11fc6"40 }41 ],42 "frameworks" : [4344 ],45 "id" : "glass-banner",46 "kind" : "content-component",47 "license" : "MIT",48 "minimumOS" : {49 "iOS" : "26.0",50 "iPadOS" : "26.0",51 "macOS" : "26.0"52 },53 "name" : "GlassBanner",54 "platforms" : [55 "iOS",56 "iPadOS",57 "macOS"58 ],59 "schemaVersion" : 1,60 "sha256" : "515ff0e998550d582f3d243343092875e419e4179b51bcc52c5126cef2187c3e",61 "symbols" : [62 "GlassBannerSeverity",63 "GlassBannerAction",64 "GlassBanner"65 ],66 "version" : "1.0.0"67}68