how to use liquid glass in swiftui

Asked on 06/11/2025

1 search

To use Liquid Glass in SwiftUI, you can follow the guidance provided in the session "Build a SwiftUI app with the new design" from WWDC 2025. Here's a brief overview of how you can implement Liquid Glass in your SwiftUI app:

  1. Gloss Effect Modifier: To add a Liquid Glass effect to your custom views, you can use the gloss effect modifier. This will apply a gloss effect within a capsule shape by default.

  2. Glass Effect ID Modifier: For more complex interactions, such as expanding and contracting elements, you can use the Glass Effect ID modifier. This involves declaring a local namespace and associating it with each of the gloss effect elements.

  3. Custom Elements: You can create custom Liquid Glass elements, such as badges or buttons, that float above your content. This is particularly useful for highlighting important controls or features in your app.

For a detailed walkthrough, you can refer to the Build a SwiftUI app with the new design (17:57) session, which covers the Liquid Glass effects in SwiftUI.