
Swiftui Liquid Glass
Apply iOS 26 Liquid Glass materials correctly in custom SwiftUI views with containers, unions, transitions, scroll edge effects, and performance/accessibility guardrails.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill swiftui-liquid-glassWhat is this skill?
- Full API surface: glassEffect(_:in:), Glass, GlassEffectContainer, glassEffectID, union, and transition modifiers
- Button styles, DefaultGlassEffectShape, scroll edge effect, and split-view background extension patterns
- Explicit availability gating for iOS 26+, iPadOS, macOS, tvOS, and watchOS 26 SDK targets
- Performance guidelines and accessibility considerations for translucent materials
- Best practices summary plus links to Apple documentation
Adoption & trust: 1.8k installs on skills.sh; 713 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Liquid Glass is a UI material and SwiftUI modifier surface you implement while building the app’s visual layer before ship. The reference is entirely SwiftUI presentation APIs—glassEffect, containers, button styles—not backend or release automation.
Common Questions / FAQ
Is Swiftui Liquid Glass safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Swiftui Liquid Glass
# Liquid Glass API Reference for SwiftUI ## Contents - [Overview](#overview) - [glassEffect(_:in:)](#glasseffect_in) - [Glass](#glass) - [GlassEffectContainer](#glasseffectcontainer) - [glassEffectID(_:in:)](#glasseffectid_in) - [glassEffectUnion(id:namespace:)](#glasseffectunionidnamespace) - [glassEffectTransition(_:)](#glasseffecttransition_) - [GlassEffectTransition](#glasseffecttransition) - [Button Styles](#button-styles) - [DefaultGlassEffectShape](#defaultglasseffectshape) - [Scroll Edge Effect](#scroll-edge-effect) - [Background Extension (Split Views)](#background-extension-split-views) - [Availability Gating](#availability-gating) - [Performance Guidelines](#performance-guidelines) - [Accessibility Considerations](#accessibility-considerations) - [Best Practices Summary](#best-practices-summary) - [Apple Documentation Links](#apple-documentation-links) ## Overview Liquid Glass is a dynamic translucent material available on iOS 26.0+, iPadOS 26.0+, macOS 26.0+, Mac Catalyst 26.0+, tvOS 26.0+, and watchOS 26.0+. It blurs content behind it, reflects color and light from surrounding content, and reacts to touch and pointer interactions in real time. Standard SwiftUI components (tab bars, toolbars, navigation bars, sheets, popovers) adopt Liquid Glass automatically when built with the latest SDK. This reference covers the complete API surface for applying Liquid Glass to custom views. ## glassEffect(_:in:) Applies the Liquid Glass effect behind a view. ```swift nonisolated func glassEffect( _ glass: Glass = .regular, in shape: some Shape = DefaultGlassEffectShape() ) -> some View ``` The system renders a shape anchored behind the view with the Liquid Glass material and applies foreground effects over the view content. The default shape is `Capsule`. Apply this modifier **after** other modifiers that affect the view's appearance (padding, frame, font, foregroundStyle). ### Basic usage ```swift Text("Hello, World!") .font(.title) .padding() .glassEffect() ``` ### Custom shape ```swift Text("Hello, World!") .font(.title) .padding() .glassEffect(in: .rect(cornerRadius: 16.0)) ``` Common shapes: `.capsule` (default), `.rect(cornerRadius:)`, `.circle`. ### Tinted and interactive ```swift Text("Hello, World!") .font(.title) .padding() .glassEffect(.regular.tint(.orange).interactive()) ``` ## Glass A structure that defines the configuration of the Liquid Glass material. Conforms to `Equatable`, `Sendable`, and `SendableMetatype`. ### Type Properties | Property | Description | |---|---| | `.regular` | Standard Liquid Glass material | | `.clear` | Clear variant with minimal visual weight | | `.identity` | No-op; content appears as if no glass effect was applied | ### Instance Methods | Method | Description | |---|---| | `.tint(_ color: Color)` | Returns a copy with a color tint to suggest prominence | | `.interactive(_ isInteractive: Bool = true)` | Returns a copy that reacts to touch and pointer interactions | Methods are chainable: ```swift .glassEffect(.regular.tint(.blue).interactive()) ``` ## GlassEffectContainer A view that combines multiple Liquid Glass shapes into a single rendering pass. Enables blending and morphing between individual shapes. ```swift @MainActor @preconcurrency struct GlassEffectContainer<Content> where Content : View ``` Conforms to `View`, `Sendable`, `SendableMetatype`. ### Initializer ```swift init(spacing: CGFloat, @ViewBuilder content: () -> Content) ``` The `spacing` parameter controls how glass shapes interact: - **Larger spacing**: Shapes begin blending at greater distances; morphing starts sooner. - **Smaller spacing**: Shapes must be closer before blending occurs. Match the container spacing to the interior layout spacing so shapes remain separate at rest but merge during animated transitions. ### Example ```swift GlassEffectContainer(spacing: 40.0) { HStack(spacing: 40.0) { Image(systemName: "scribble.