Glass

A structure that defines the configuration of a physical glass material.

StructureiOS 26.0+macOS 26.0+tvOS 26.0+watchOS 26.0+Glass in SwiftUI

Declaration

React
type Glass = 'clear' | 'identity' | 'regular' | GlassChain;
Swift
struct Glass

Pass a literal, or build one with SwiftUI.Glass from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'clear'SwiftUI.Glass.clear

    The clear variant of glass.

  • 'identity'SwiftUI.Glass.identity

    The identity variant of glass. When applied, your content remains unaffected as if no glass effect was applied.

  • 'regular'SwiftUI.Glass.regular

    The 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.