glass(_:)
A button style that applies a configurable Liquid Glass effect based on the button’s context.
Declaration
@MainActor @preconcurrency static func glass(_ glass: Glass) -> SelfDiscussion
This button style applies a Liquid Glass effect that you can customize by specifying a tint or variant. In the following example, the button renders using the clear variant of Liquid Glass:
Button("Button") {}
.buttonStyle(.glass(.clear))In tvOS, this button style applies a Liquid Glass effect regardless of whether the button has focus. This style is similar to the bordered style.
To apply this style to a button, or to a view that contains buttons, use the buttonStyle(_:) modifier.