what about GlassEffectContainer?

Asked on 06/11/2025

1 search

The GlassEffectContainer is a feature introduced by Apple to enhance the visual consistency and performance of glass effects in app design. It is used to group multiple glass elements together into a single rendering effect. This grouping is essential for achieving a consistent visual result, as glass elements cannot directly sample other glass elements. By using a GlassEffectContainer, these elements share their sampling region, which not only provides a more consistent visual appearance but also improves performance by requiring only one sampling pass for the entire group.

In the session "Build an AppKit app with the new design" at WWDC 2025, it was demonstrated how to set up a GlassEffectContainer. The container allows glass elements to fluidly join and separate, creating a liquid visual effect. This is particularly useful when you have multiple glass shapes in close proximity, as it ensures they maintain a uniform appearance as the underlying content changes.

For more details, you can refer to the session Build an AppKit app with the new design (17:30).