Glass
A structure that defines the configuration of a physical glass material.
Declaration
type Glass = 'clear' | 'identity' | 'regular' | GlassChain;struct GlassPass a literal, or build one with SwiftUI.Glass from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'clear'SwiftUI.Glass.clearThe clear variant of glass.
'identity'SwiftUI.Glass.identityThe identity variant of glass. When applied, your content remains unaffected as if no glass effect was applied.
'regular'SwiftUI.Glass.regularThe regular variant of glass.
Overview
You provide instances of glass to the View.glassEffect(_:in)
view modifier which:
Label("Flag", systemImage: "flag.fill")
.padding()
.glassEffect()You can combine glass effects by using a GlassEffectContainer
which supports morphing glass shapes into each other based on
the geometry of their associated views.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Appearance.
- BackgroundProminenceThe prominence of backgrounds underneath other views.
- BadgeProminenceThe visual prominence of a badge.
- ButtonSizingThe sizing behavior of Buttons and other button-like controls.
- ColorA representation of a color that adapts to a given context.
- ColorRenderingModeThe set of possible working color spaces for color-compositing operations.
- ColorResolvedA concrete color value.
- ColorResolvedHDRA concrete color value, including HDR headroom information.
- ColorRGBColorSpaceA profile that specifies how to interpret a color value for display.
- ColorSchemeThe possible color schemes, corresponding to the light and dark appearances.
- GlassChainGlass with chained calls: SwiftUI.Glass.interactive(...).
- ImageScaleA scale to apply to vector images relative to text.
- ProminenceA type indicating the prominence of a view hierarchy.