Repository Public MIT
1# GlassIconButton23| | |4|---|---|5| Identifier | `glass-icon-button` |6| Module | `SPGlassComponents` |7| Kind | `native-wrapper` — a system glass button with a circular border shape |8| Platforms | iOS 26, iPadOS 26, macOS 26 |9| Example | `Examples/Gallery/Buttons/GlassIconButtonExample.swift` |1011## Minimal usage1213```swift14GlassIconButton(systemImage: "square.and.arrow.up", accessibilityLabel: "Share") { share() }15```1617## Variants1819| Variant | Use |20|---|---|21| `.regular` | Secondary actions in toolbars and over content. |22| `.prominent` | The selected or main action of a group. |23| `role: .destructive` | Deletion; tinted with the theme's `destructive` colour. |2425## Parameters2627| Parameter | Type | Default | Meaning |28|---|---|---|---|29| `systemImage` | `String` | — | SF Symbol name. |30| `accessibilityLabel` | `LocalizedStringKey` | — | Required. Read by VoiceOver, shown as the tooltip on macOS, used by Voice Control. |31| `label` | `Text` | — | Alternative to `accessibilityLabel` when the text is already a `Text`. |32| `variant` | `GlassButtonVariant` | `.regular` | Visual weight. |33| `role` | `ButtonRole?` | `nil` | System role. |34| `size` | `GlassControlSize` | `.regular` | Control size. |35| `action` | `@MainActor () -> Void` | — | Called on activation. |3637## States3839Idle, pressed, focused and disabled (`.disabled(_:)`) are drawn by the system. There is no loading state: replace the symbol or show progress elsewhere.4041## Advanced example4243```swift44GlassIconButton(45 systemImage: isFavourite ? "star.fill" : "star",46 accessibilityLabel: isFavourite ? "Remove from favourites" : "Add to favourites",47 variant: isFavourite ? .prominent : .regular48) { isFavourite.toggle() }49.keyboardShortcut("d", modifiers: .command)50```5152## Accessibility5354- A label is mandatory in the initialiser; a symbol alone is never the accessible name.55- The tappable area is at least 44 × 44 points on iOS and iPadOS, and 24 × 24 on macOS, at every size.56- The label is also the tooltip on macOS (`.help`).57- State must not rely on the symbol colour alone: change the symbol or the label, as in the example.5859## Limits6061- The symbol cannot be rotated or animated through this component; components that need that draw their own glass circle.62- The glass is drawn by the system and cannot be configured.63