Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dpearson2699 avatar

Swiftui Liquid Glass

  • 2.9k installs
  • 944 repo stars
  • Updated July 15, 2026
  • dpearson2699/swift-ios-skills

swiftui-liquid-glass is a SwiftUI skill for iOS 26 Liquid Glass effects, containers, button styles, morphing transitions, and availability fallbacks.

About

The swiftui-liquid-glass skill implements Apple's Liquid Glass translucent material introduced in iOS 26 across custom controls and navigation layers. Standard tab bars, toolbars, navigation bars, and sheets adopt the material automatically when built with the iOS 26 SDK, while custom views use glassEffect, GlassEffectContainer, and glass button styles. Workflows cover picking target surfaces, wrapping grouped glass in containers, applying glassEffect after layout modifiers, adding interactive only on tappable elements, and morphing with glassEffectID and glassEffectTransition matchedGeometry or materialize choices. API summary documents Glass variants regular, clear, identity, tint, and interactive chaining, plus ToolbarSpacer, scrollEdgeEffectStyle, and backgroundExtensionEffect companions. Common mistakes warn against glass on all content, static status masquerading as buttons, nested containers, interactive on read-only badges, wrong modifier order, and missing iOS 26 availability gates with fallbacks. Review checklist spans container usage, transition types, clear glass contrast, accessibility with Reduce Transparency, and Sendable ID requirements.

  • glassEffect modifier with Glass variants and tint chaining.
  • GlassEffectContainer grouping for blending and morphing performance.
  • glass and glassProminent button styles with clear variant contrast rules.
  • Morphing transitions via glassEffectID and matchedGeometry or materialize.
  • iOS 26 availability gates with bordered fallback controls.

Swiftui Liquid Glass by the numbers

  • 2,860 all-time installs (skills.sh)
  • +128 installs in the week ending Jul 29, 2026 (Skillselion tracking)
  • Ranked #58 of 1,039 Mobile Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
At a glance

swiftui-liquid-glass capabilities & compatibility

Capabilities
glasseffect and glass variant configuration · glasseffectcontainer grouping and spacing contro · morphing transitions with glasseffectid namespac · glass and glassprominent button style applicatio · scroll edge and background extension companion a · availability gating and accessibility contrast r
Use cases
ui design · frontend
Platforms
macOS
Pricing
Free
From the docs

What swiftui-liquid-glass says it does

Liquid Glass belongs in the controls/navigation layer; do not use it to decorate static content containers.
SKILL.md
`.interactive()` adds visual affordance suggesting tappability.
SKILL.md
Gate with `if #available(iOS 26, *)` and provide a fallback for earlier versions.
SKILL.md
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill swiftui-liquid-glass

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.9k
repo stars944
Security audit3 / 3 scanners passed
Last updatedJuly 15, 2026
Repositorydpearson2699/swift-ios-skills

How do I apply Liquid Glass correctly on custom SwiftUI controls without misleading interactive affordances or layout bugs?

Implement iOS 26 Liquid Glass effects with glassEffect, containers, button styles, morphing transitions, and availability fallbacks.

Who is it for?

iOS developers adopting iOS 26 Liquid Glass on custom toolbars, floating controls, and morphing UI groups.

Skip if: Skip for pre-iOS 26-only apps without fallback UI, static content backgrounds, or UIKit-only screens without SwiftUI glass.

When should I use this skill?

User asks about Liquid Glass, glassEffect, GlassEffectContainer, glass buttons, morphing transitions, or iOS 26 design adoption.

What you get

Grouped glass controls with correct modifier order, morphing transitions, interactive only where needed, and iOS 26 gated fallbacks.

  • Liquid Glass SwiftUI view implementations
  • coordinated glass animation setup

By the numbers

  • Documents 8+ Liquid Glass SwiftUI APIs including glassEffect, GlassEffectContainer, and glassEffectTransition

Files

SKILL.mdMarkdownGitHub ↗

SwiftUI Liquid Glass

Liquid Glass is the dynamic translucent material introduced in iOS 26 (and iPadOS 26, macOS 26, tvOS 26, watchOS 26). It blurs content behind it, reflects surrounding color and light, and reacts to touch and pointer interactions. Standard SwiftUI components (tab bars, toolbars, navigation bars, sheets) adopt Liquid Glass automatically when built with the iOS 26 SDK. Treat custom Liquid Glass as a controls/navigation-layer effect, not a general content background. Use the APIs below for custom views and controls that need that functional layer.

See references/liquid-glass.md for the full API reference with additional examples.

Contents

Workflow

Choose the path that matches the request:

1. Implement a new feature with Liquid Glass

1. Identify target surfaces (floating controls, custom bars, transient controls). 2. Decide shape, prominence, and whether each element is a real control or static status. 3. Wrap grouped glass elements in a GlassEffectContainer. 4. Apply .glassEffect() after layout and appearance modifiers. 5. Add .interactive() only to tappable/focusable elements. 6. Add morphing transitions with glassEffectID(_:in:) where the view hierarchy changes with animation. Put glassEffectTransition(_:) on the inserted or removed glass child, not on the always-present container. Name the transition choice: .matchedGeometry for nearby effects inside container spacing; .materialize for distant insertion/removal or no geometry match. 7. Gate with if #available(iOS 26, *) and provide a fallback for earlier versions.

2. Improve an existing feature with Liquid Glass

1. Find custom control or navigation backgrounds that can be replaced with .glassEffect(). 2. Wrap sibling glass elements in GlassEffectContainer for blending and performance. 3. Replace custom glass-like buttons with .buttonStyle(.glass), .buttonStyle(.glassProminent), or configurable styles such as .buttonStyle(.glass(.clear)). Use .glass(_:) when the button needs a specific tint or variant; reserve .glassProminent for high-emphasis primary actions. 4. Add morphing transitions where animated insertion/removal occurs.

3. Review existing Liquid Glass usage

Run through the Review Checklist below and verify each item.

Core API Summary

glassEffect(_:in:)

Applies Liquid Glass behind a view. Default: .regular variant in a Capsule shape.

nonisolated func glassEffect(
    _ glass: Glass = .regular,
    in shape: some Shape = DefaultGlassEffectShape()
) -> some View

Glass struct

Property / MethodPurpose
.regularStandard glass material
.clearClear variant; add dimming/contrast treatment when legibility needs it
.identityNo visual effect (pass-through)
.tint(_:)Add a color tint for prominence
.interactive(_:)React to touch and pointer interactions

Chain them: .regular.tint(.blue).interactive()

GlassEffectContainer

Wraps multiple glass views for shared rendering, blending, and morphing.

GlassEffectContainer(spacing: 24) {
    // child views with .glassEffect()
}

The spacing controls when nearby glass shapes begin to blend. Match or exceed the interior layout spacing so shapes merge during animated transitions but remain separate at rest.

Morphing & Transitions

ModifierPurpose
glassEffectID(_:in:)Stable identity for morphing during view hierarchy changes
glassEffectUnion(id:namespace:)Merge multiple views into one glass shape
glassEffectTransition(_:)Control how glass appears/disappears

Transition decision: use .matchedGeometry for nearby effects inside the container's spacing; use .materialize for distant insertion/removal or when no geometry match should occur; use .identity only when no transition animation is wanted.

Button Styles

Button("Action") { }
    .buttonStyle(.glass)           // standard glass button

Button("Primary") { }
    .buttonStyle(.glassProminent)  // prominent glass button

Button("Media") { }
    .buttonStyle(.glass(.clear))    // configurable variant; verify contrast

Scroll Edge Effects and Background Extension (iOS 26+)

These complement Liquid Glass when building custom toolbars and scroll views:

ScrollView {
    content
}
.scrollEdgeEffectStyle(.soft, for: .top)  // Configures edge effect at scroll boundaries

// Duplicate view into mirrored copies at safe area edges with blur (e.g., under sidebars)
content
    .backgroundExtensionEffect()

ToolbarSpacer (iOS 26+)

Creates a visual break between items in toolbars:

.toolbar {
    ToolbarItem { Button("Edit") { } }
    ToolbarSpacer(.fixed)
    ToolbarItem { Button("Share") { } }
}

Code Examples

Glass button with availability gate

if #available(iOS 26, *) {
    Button("Show Status") { showStatusDetails() }
        .buttonStyle(.glass)
} else {
    Button("Show Status") { showStatusDetails() }
        .buttonStyle(.bordered)
}

Grouped glass shapes in a container

let symbols = ["pencil", "eraser.fill", "lasso"]

GlassEffectContainer(spacing: 24) {
    HStack(spacing: 24) {
        ForEach(symbols, id: \.self) { symbol in
            Image(systemName: symbol)
                .frame(width: 56, height: 56)
                .glassEffect()
        }
    }
}

Nearby morphing transition

@State private var isExpanded = false
@Namespace private var ns

var body: some View {
    GlassEffectContainer(spacing: 40) {
        HStack(spacing: 40) {
            Image(systemName: "pencil")
                .frame(width: 80, height: 80)
                .glassEffect()
                .glassEffectID("pencil", in: ns)

            if isExpanded {
                Image(systemName: "eraser.fill")
                    .frame(width: 80, height: 80)
                    .glassEffect()
                    .glassEffectID("eraser", in: ns)
                    .glassEffectTransition(.matchedGeometry)
            }
        }
    }

    Button("Toggle") {
        withAnimation { isExpanded.toggle() }
    }
    .buttonStyle(.glass)
}

For distant inserted or removed glass that should not morph from a nearby control, use .glassEffectTransition(.materialize) on the conditional child instead.

Unioning views into a single glass shape

@Namespace private var ns

GlassEffectContainer(spacing: 20) {
    HStack(spacing: 20) {
        ForEach(items.indices, id: \.self) { i in
            Image(systemName: items[i])
                .frame(width: 80, height: 80)
                .glassEffect()
                .glassEffectUnion(id: i < 2 ? "group1" : "group2", namespace: ns)
        }
    }
}

Tinted glass icon control

struct GlassIconControl: View {
    let icon: String
    let tint: Color
    let action: () -> Void

    var body: some View {
        Button(action: action) {
            Image(systemName: icon)
                .font(.title2)
                .padding()
        }
        .buttonStyle(.glass(.regular.tint(tint)))
    }
}

Clear glass action over bright content

if #available(iOS 26, *) {
    ZStack {
        Capsule()
            .fill(.black.opacity(0.28))

        Button {
            playRecap()
        } label: {
            Label("Play", systemImage: "play.fill")
                .font(.headline)
                .padding(.horizontal, 8)
        }
        .buttonStyle(.glass(.clear))
    }
    .fixedSize()
} else {
    Button("Play", systemImage: "play.fill") { playRecap() }
        .buttonStyle(.borderedProminent)
}

Use clear glass only when the background still leaves labels and symbols readable. On bright or busy backgrounds, add a subtle dimming layer or choose a more opaque button style.

Static status count, not a toolbar control

VStack(spacing: 8) {
    Text("24")
        .font(.headline.monospacedDigit())
        .accessibilityLabel("24 options expiring")

    Text("Options Expiring")
        .font(.subheadline)
        .foregroundStyle(.secondary)
}
// Keep read-only status out of toolbar control slots and do not add .interactive().

Common Mistakes

DON'T: Apply Liquid Glass to every surface

Overuse distracts from content. Liquid Glass belongs in the controls/navigation layer; do not use it to decorate static content containers.

// WRONG: Glass on everything
VStack {
    Text("Title").glassEffect()
    Text("Subtitle").glassEffect()
    Divider().glassEffect()
    Text("Body").glassEffect()
}

// CORRECT: Static content stays in the content layer
VStack {
    Text("Title").font(.title)
    Text("Subtitle").font(.subheadline)
    Divider()
    Text("Body")
}

Button("Add") { addItem() }
    .buttonStyle(.glass)

DON'T: Make static status look tappable

Counts, badges, summaries, and read-only status chips should not live in toolbar action slots or use .interactive() unless they initiate an immediate action. If a badge belongs to a real toolbar action, make the action one accessible control and keep the badge subordinate to that control.

DON'T: Nest GlassEffectContainer for one related group

Use one container for the related glass group so rendering, blending, and morphing scope stay predictable.

// WRONG
GlassEffectContainer {
    GlassEffectContainer {
        content.glassEffect()
    }
}

// CORRECT: Single container wrapping all glass views
GlassEffectContainer {
    content.glassEffect()
}

DON'T: Add .interactive() to non-interactive elements

.interactive() adds visual affordance suggesting tappability. Using it on decorative or read-only status glass misleads users.

DON'T: Apply .glassEffect() before layout modifiers

Glass calculates its shape from the final frame. Applying it before padding/frame produces incorrect bounds.

// WRONG: Glass applied before padding
Text("Label").glassEffect().padding()

// CORRECT: Glass applied after layout
Text("Label").padding().glassEffect()

DON'T: Forget accessibility testing

Always test with Reduce Transparency and Reduce Motion enabled. System settings can remove or modify translucency and motion, so verify custom glass content remains readable.

DON'T: Skip availability checks

Liquid Glass requires iOS 26+. Gate with if #available(iOS 26, *) and provide a fallback.

Review Checklist

  • [ ] Availability: if #available(iOS 26, *) present with fallback UI.
  • [ ] Container: Multiple glass views wrapped in GlassEffectContainer.
  • [ ] Modifier order: .glassEffect() applied after layout/appearance modifiers.
  • [ ] Interactivity: .interactive() used only where user interaction exists.
  • [ ] Status vs action: Static counts/status are not toolbar controls and do not expose press/hover affordance.
  • [ ] Transitions: glassEffectID used with @Namespace for morphing animations.
  • [ ] Transition type: .matchedGeometry for nearby effects; .materialize for distant ones, applied to the conditional glass child.
  • [ ] Consistency: Shapes, tints, and spacing are uniform across related elements.
  • [ ] Performance: Glass effects are limited in number; container used for grouping.
  • [ ] Accessibility: Tested with Reduce Transparency and Reduce Motion enabled.
  • [ ] Button styles: Standard .glass, .glassProminent, or configurable .glass(_:) used for buttons; .glass(_:) is primary when a tint or clear variant is required.
  • [ ] Clear glass contrast: Clear glass over bright content has a dimming/contrast treatment or uses a more legible style.
  • [ ] Concurrency: IDs passed to glassEffectID / glassEffectUnion are Sendable; MainActor-annotated Liquid Glass APIs stay in SwiftUI UI code.

References

Related skills

FAQ

Where should Liquid Glass be applied?

On controls and navigation layers, not as decoration across static content containers.

When should interactive be used?

Only on tappable or focusable elements; read-only status badges should not look pressable.

What modifier order does glassEffect require?

Apply glassEffect after layout and appearance modifiers such as padding and frame so bounds are final.

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.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.