FioriGlassButtonStyle
@available(iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, *)
@available(visionOS, unavailable)
public struct FioriGlassButtonStyle : FioriButtonStyle
A Fiori button style that renders the button with a glass material effect.
FioriGlassButtonStyle leverages the system’s liquid glass rendering introduced
in iOS 26, macOS 26, tvOS 26, and watchOS 26 to produce a translucent, frosted
appearance that adapts to the content behind the button.
Overview
Use .fioriButtonStyle(FioriGlassButtonStyle()) to apply this style to a
FioriButton or any view that contains Fiori buttons. You can control the
visual treatment by passing a FioriButtonGlassEffectStyle value:
| Style | Appearance | Label color |
|---|---|---|
.plain (default) |
Untinted frosted glass | Primary label |
.tint |
Glass tinted with the app’s tint color | White |
.systemManaged |
No glass applied; the system provides it | Primary label |
Layout
The button enforces a minimum tap target width of 44 pt and applies default
padding of 8 pt vertically and 16 pt horizontally. You can extend the button
to fill available width or set a custom minimum height through maxWidth and
minHeight.
Availability
This style requires iOS 26, macOS 26, tvOS 26, or watchOS 26 and later. It is not available on visionOS, where the platform provides its own depth-aware material treatments.
Example
// Default plain glass button
FioriButton { _ in Text("Confirm") }
.fioriButtonStyle(FioriGlassButtonStyle())
// Full-width tinted glass button
FioriButton { _ in Text("Submit") }
.fioriButtonStyle(FioriGlassButtonStyle(glassEffect: .tint, maxWidth: .infinity))
// Inside a toolbar — system handles the glass background
ToolbarItem {
FioriButton { _ in Text("Done") }
.fioriButtonStyle(FioriGlassButtonStyle(glassEffect: .systemManaged))
}
Note
When using.systemManaged, do not nest this button inside another view
that already applies a glass effect, as doing so may produce unexpected
layering artifacts.
-
Creates a
FioriGlassButtonStyleinstance.Declaration
Swift
public init(glassEffect: FioriButtonGlassEffectStyle = .plain, maxWidth: CGFloat? = nil, minHeight: CGFloat? = nil)Parameters
glassEffectThe glass effect style applied to the button. Defaults to
.plain. Use.tintto apply the app’s tint color to the glass material, or.systemManagedwhen the button is placed inside a container where the system supplies the glass background.maxWidthThe maximum width of the button’s visible area. Pass
.infinityto make the button expand to fill its container. Defaults tonil(intrinsic size).minHeightThe minimum height of the button’s visible area. Defaults to
nil(intrinsic size). -
Declaration
Swift
public func makeBody(configuration: Configuration) -> some View