Can I make a window be made of glass material?
Asked on 06/16/2025
1 search
Yes, you can make a window be made of glass material using Apple's new Liquid Glass material. This material is designed to create a translucent, dynamic effect that behaves like real glass. It can be used in both AppKit and SwiftUI applications to enhance the visual hierarchy and provide a distinct functional layer for controls and navigation.
For AppKit, you can use the NSGlassEffectView
to apply the Liquid Glass material to your window or specific UI elements. This involves creating an NSGlassEffectView
for each glass element you want to display and setting its content view property to the desired view. You can also group multiple glass elements using an NSGlassEffectContainerView
to ensure a consistent visual result and improve performance.
For SwiftUI, you can use the container background modifier to replace the window background color with a material that resembles frosted glass, allowing color from the desktop to shine through.
For more details on how to implement this, you can refer to the session Build an AppKit app with the new design (17:30) and Tailor macOS windows with SwiftUI (03:53).

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.

Tailor macOS windows with SwiftUI
Make your windows feel tailor-made for macOS. Fine-tune your app’s windows for focused purposes, ease of use, and to express functionality. Use SwiftUI to style window toolbars and backgrounds. Arrange your windows with precision, and make smart decisions about restoration and minimization.

Meet Liquid Glass
Liquid Glass unifies Apple platform design language while providing a more dynamic and expressive user experience. Get to know the design principles of Liquid Glass, explore its core optical and physical properties, and learn where to use it and why.