Docs

SwiftUI Liquid Glass guide (iOS 26)

How to use Liquid Glass in SwiftUI with glassEffect, GlassEffectContainer and glassEffectID, and how to fall back to Material below iOS 26.

Liquid Glass shipped with iOS 26. The APIs are small, but the failure modes are not: glass sampling glass, missing fallbacks, invented modifiers from tutorials. Every glass piece here follows the same rules.

The rules

  1. Gate it. if #available(iOS 26, *) around every glass call, with a Material fallback in the else branch.
  2. Respect Reduce Transparency. Read @Environment(\.accessibilityReduceTransparency) and fall back to an opaque surface when it is on.
  3. One container per group. Wrap sibling glass views in a single GlassEffectContainer(spacing:) so they render as one layer and can morph.
  4. Glass goes last. Apply .glassEffect after layout and appearance modifiers.
  5. Morph with IDs. Pair .glassEffectID(_:in:) with a @Namespace to animate between shapes on state change.
  6. Only real APIs. .liquidGlassUltra, .fill(.liquidGlass) and friends do not exist. The pieces here are type-checked against the SDK in CI.

The verified surface

APINotes
glassEffect(_:in:)Defaults to .regular and a capsule.
Glass.regular, .clear, .identity.identity disables glass.
Glass.tint(_:), Glass.interactive(_:)Chainable.
GlassEffectContainer(spacing:content:)Required for multiple glass views.
glassEffectID(_:in:), glassEffectUnion(id:namespace:)Morphing and manual merging.
.buttonStyle(.glass), .glassProminentSystem glass buttons.

The fallback pattern

if #available(iOS 26, *), !reduceTransparency {
    content.glassEffect(.regular.interactive(), in: shape)
} else {
    content.background(.ultraThinMaterial, in: shape)
}

Liquid Glass pieces

Every piece below follows the rules above and builds from iOS 17, drawing glass on iOS 26 and its designed fallback everywhere else.

  • Glass Surface: the foundation. Glass in a capsule, rect, circle or concentric shape, with a layered Material fallback that keeps the press response and specular edge.
  • Glass Segments: a segmented control whose glass indicator you can grab and drag.
  • Glass Action Menu: a floating trigger that long-presses open into actions you slide across and release to fire.
  • Floating Dock: a floating tab bar that tucks away on scroll.
  • Glass Text: Liquid Glass on the actual glyph outlines of a string.

See them side by side on the SwiftUI Liquid Glass components page, or add one with npx swiftpieces add GlassSurface.

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro