hwo to apply a glass effect as a background of my vstack ?
Asked on 06/20/2025
1 search
To apply a glass effect as a background to your VStack
in a SwiftUI app, you can use the Liquid Glass effect introduced in the WWDC sessions. Here's a general approach based on the information from the sessions:
-
Create a Glass Effect Container: Use a glass effect container to group your elements. This ensures that the glass effect is applied consistently across the elements and improves performance by sharing the sampling region.
-
Apply the Glass Effect: Use the
Glass Effect ID
modifier to apply the glass effect to yourVStack
. This involves declaring a local namespace and associating it with the glass effect elements. -
Use the Liquid Glass Material: The Liquid Glass material reflects and refracts light, picking color from nearby content. It adapts to its surroundings, ensuring clarity and legibility.
For a detailed example, you can refer to the session Build a SwiftUI app with the new design (17:57) where the Liquid Glass effects are discussed. This session provides insights into how to implement and use the Liquid Glass effect in your SwiftUI app.

Build an AppKit app with the new design
Update your AppKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.

Build a SwiftUI app with the new design
Explore the ways Liquid Glass transforms the look and feel of your app. Discover how this stunning new material enhances toolbars, controls, and app structures across platforms, providing delightful interactions and seamlessly integrating your app with the system. Learn how to adopt new APIs that can help you make the most of Liquid Glass.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.