---
title: "Glass effect | Explore SwiftUI"
description: "Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/view/glass-effect"
meta:
  author: "Explore SwiftUI"
  "og:description": "Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Glass%2Beffect%2Cdescription_Applies%2Bthe%2BLiquid%2BGlass%2Beffect%2Bto%2Ba%2Bview%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvODUvdmFyaWFudHMvMzM~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyJdfQ%2Cp_Ii9saWJyYXJ5L3ZpZXcvZ2xhc3MtZWZmZWN0Ig%2Cs_bDZIBr3H8MEQqR9j.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Glass effect | Explore SwiftUI"
  "twitter:description": "Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Glass%2Beffect%2Cdescription_Applies%2Bthe%2BLiquid%2BGlass%2Beffect%2Bto%2Ba%2Bview%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvODUvdmFyaWFudHMvMzM~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyJdfQ%2Cp_Ii9saWJyYXJ5L3ZpZXcvZ2xhc3MtZWZmZWN0Ig%2Cs_bDZIBr3H8MEQqR9j.png"
  "twitter:title": "Glass effect | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=85)

# **Glass effect**

Applies the Liquid Glass effect to a view

![Glass effect - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/85/variants/33?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ tvOS 26.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/view/glasseffect(_:in:isenabled:)>)

```
HStack {
  Text("Foo")
    .padding()
    .glassEffect()
  Text("Foo")
    .padding()
    .glassEffect(in: .rect(cornerRadius: 10))
  Text("Foo")
    .padding()
    .glassEffect(.regular.interactive())
  Text("Foo")
    .padding()
    .glassEffect(.regular.tint(.red))
}
```

### **Found an issue or have a suggestion?**

Created: June 10, 2025Updated: June 10, 2025

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **More View Components **

[**View all **](https://exploreswiftui.com/library/view)

![VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/260/variants/2143?v=1793707679045&r=2&w=412&q=75&f=webp)

### **VisionOS background materials**

All background materials on visionOS

![Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/257/variants/1987?v=1792070676534&r=2&w=412&q=75&f=webp)

### **Container Content Margins**

Adds the margins of the container the view is in.

![Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/254/variants/1863?v=1790589836833&r=2&w=412&q=75&f=webp)

### **Toolbar Vertical Edge**

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

![Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2&w=412&q=75&f=webp)

### **Hinge State**

A type encapsulating the state of a single hinge.

![Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/246/variants/1636?v=1790277107518&r=2&w=412&q=75&f=webp)

### **Disabled Toolbar Vertical Behavior**

Disables the vertical bar.

![Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Music Picker**

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

![App Store Overlay - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/224/variants/269?v=1790073478842&r=2&w=412&q=75&f=webp)

### **App Store Overlay**

Presents a StoreKit overlay when a given condition is true.

![Manage Subscriptions Sheet - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/223/variants/241?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Manage Subscriptions Sheet**

Opens the manage subscriptions sheet.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Hidden List Row Separator - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/120/variants/343?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Hidden List Row Separator**

Sets the display mode to hidden for the separator associated with this specific row.

![Icon Phase Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/216/variants/705?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Icon Phase Store View**

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using their promotional images and a custom placeholder icon.

![SegmentedPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/185/variants/583?v=1790073478842&r=2&w=412&q=75&f=webp)

### **SegmentedPickerStyle**

A picker style that presents the options in a segmented control. Use this style when there are two to five options. Consider using menu when there are more than five options.

![MenuPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/180/variants/592?v=1790073478842&r=2&w=412&q=75&f=webp)

### **MenuPickerStyle**

A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.

![Future DatePicker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/60/variants/155?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Future DatePicker**

Creates an instance that selects a Date in a closed range

![Multiple Sources Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/175/variants/568?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Multiple Sources Picker**

Creates a picker that updates the selected property for all sources.

![LinearProgressViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/79/variants/103?v=1790073478842&r=2&w=412&q=75&f=webp)

### **LinearProgressViewStyle**

A progress view that visually indicates its progress using a horizontal bar

![Axis Behavior - iOS on iPhone Duo - Landscape - Closed - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/247/variants/1692?v=1790586402346&r=2&w=412&q=75&f=webp)

### **Axis Behavior**

The bar axis behavior of the toolbar item.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/glass-effect#webpage","@type":"WebPage","dateModified":"2025-06-10T09:43:15.137Z","datePublished":"2025-06-10T06:13:22.295Z","description":"Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Glass effect","url":"https://exploreswiftui.com/library/view/glass-effect","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/glass-effect#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/glass-effect"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/view/glass-effect#article","dateModified":"2025-06-10T09:43:15.137Z","datePublished":"2025-06-10T06:13:22.295Z","description":"Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"Glass effect","inLanguage":"en-US","name":"Glass effect","thumbnailUrl":"https://exploreswiftui.com/api/images/85/variants/33?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/view/glass-effect","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/glass-effect#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/glass-effect#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/view/glasseffect(_:in:isenabled:)","codeSampleType":"full example","description":"Applies the Liquid Glass effect to a view. Learn how to use Glass effect in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Glass effect SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"HStack {\n  Text(\"Foo\")\n    .padding()\n    .glassEffect()\n  Text(\"Foo\")\n    .padding()\n    .glassEffect(in: .rect(cornerRadius: 10))\n  Text(\"Foo\")\n    .padding()\n    .glassEffect(.regular.interactive())\n  Text(\"Foo\")\n    .padding()\n    .glassEffect(.regular.tint(.red))\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Glass effect"}]},{"@id":"https://exploreswiftui.com/library/view/glass-effect#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"View","item":"https://exploreswiftui.com/library/view","position":2},{"@type":"ListItem","name":"Glass effect","item":"https://exploreswiftui.com/library/view/glass-effect","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/85/variants/33?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/85/variants/33?v=1790073478842&r=2"}]}
```