Differrence between `.buttonStyle(.glass)` and `.glassEffect()`

Asked on 06/11/2025

1 search

The difference between .buttonStyle(.glass) and .glassEffect() lies in their application and purpose within the UI design.

  1. .buttonStyle(.glass): This is a button style that applies a glass-like appearance to buttons. It is part of the new design system that uses Liquid Glass material to give buttons a distinct, floating appearance. This style is particularly useful for buttons that need to stand out and provide a tactile, interactive experience. The glass button style can be customized with different appearances, such as standard glass or prominent glass, which can be tinted with your app's tint color.

  2. .glassEffect(): This is a modifier that applies a glass effect to a view, giving it a translucent, glass-like appearance. The glass effect is designed to be an interactive layer that floats above the content, providing a distinct visual separation. It adapts to the content behind it, ensuring legibility and contrast. The glass effect can be used in various UI elements to create a cohesive and immersive design.

Both .buttonStyle(.glass) and .glassEffect() are part of the Liquid Glass design language introduced by Apple, which aims to create a unified and interactive visual experience across different platforms. They are used to enhance the appearance and interactivity of UI elements by leveraging the properties of the Liquid Glass material.

For more details on how these are implemented, you can refer to the session Build a UIKit app with the new design (17:24) and Meet Liquid Glass (06:00).