Liquid Glass in SwiftUI: A Practical Guide for iOS 26
Liquid Glass is the design language Apple introduced with iOS 26: translucent, light-bending material that floats above content and reacts to touch. The good news for SwiftUI developers is that most of it is free. Rebuild with the iOS 26 SDK and tab bars, navigation bars, toolbars, sheets and menus adopt it automatically. This guide is about the rest: putting glass on your own views without making the app look like a tech demo.
The one rule: glass is for controls, not content
Apple's guidance is consistent: Liquid Glass belongs to the navigation and control layer that floats above your content, such as toolbars, floating buttons and small overlays. Lists, cards and text you read stay on solid surfaces. Glass on glass, or glass behind body text, loses legibility fast. If you remember one thing, make it this.
glassEffect: glass on any view
glassEffect(_:in:) puts a glass background behind a view. With no arguments it uses the regular glass in a capsule:
Label("Shuffle", systemImage: "shuffle")
.padding(.horizontal, 20)
.padding(.vertical, 12)
.glassEffect()Pass a shape to change the outline, and configure the glass itself with tint and interactive:
Image(systemName: "plus")
.font(.title2.weight(.semibold))
.frame(width: 56, height: 56)
.glassEffect(.regular.tint(.orange).interactive(), in: .circle)
Text("Recording")
.padding()
.glassEffect(.regular, in: .rect(cornerRadius: 16)).regularis the default material;.clearis more transparent and suits glass over rich media such as photos and video..tint(_:)colors the glass. Use it to mark the primary action, not to decorate everything..interactive()makes the glass respond to touch with the same press and shimmer as system controls. It only has an effect on iOS.
Apply glassEffect after padding and frame modifiers, so the glass covers the whole control rather than just its label.
Glass buttons
For buttons you rarely need glassEffect directly. iOS 26 adds two button styles:
HStack {
Button("Skip") { skip() }
.buttonStyle(.glass)
Button("Continue") { next() }
.buttonStyle(.glassProminent)
.tint(.indigo)
}
.controlSize(.large).glass is the secondary, translucent style; .glassProminent is the opaque, tinted one for the screen's main action. One prominent button per screen keeps the hierarchy obvious.
GlassEffectContainer: glass that blends
Glass can't sample other glass, so separate glass shapes sitting next to each other look wrong. Wrap them in a GlassEffectContainer: shapes inside it render together, and shapes closer than the container's spacing melt into each other like drops of liquid.
GlassEffectContainer(spacing: 24) {
HStack(spacing: 24) {
ForEach(["pencil", "eraser", "lasso"], id: \.self) { tool in
Image(systemName: tool)
.frame(width: 48, height: 48)
.glassEffect(.regular.interactive())
}
}
}Containers are also cheaper to render than many separate glass views, so use one whenever you have a group of glass controls.
Morphing with glassEffectID
Give glass views an identity with glassEffectID(_:in:) and a @Namespace, and when one appears or disappears inside an animation, the glass morphs between shapes instead of fading. This is how a floating button can grow into a row of actions:
struct FloatingActions: View {
@State private var isExpanded = false
@Namespace private var glass
var body: some View {
GlassEffectContainer(spacing: 16) {
HStack(spacing: 16) {
if isExpanded {
ForEach(["camera", "photo", "doc"], id: \.self) { action in
Image(systemName: action)
.frame(width: 52, height: 52)
.glassEffect(.regular.interactive())
.glassEffectID(action, in: glass)
}
}
Button {
withAnimation(.bouncy) { isExpanded.toggle() }
} label: {
Image(systemName: isExpanded ? "xmark" : "plus")
.font(.title2.weight(.semibold))
.frame(width: 56, height: 56)
}
.glassEffect(.regular.tint(.blue).interactive(), in: .circle)
.glassEffectID("toggle", in: glass)
}
}
}
}Every morphing view needs its own ID, they all need to be inside the same container, and the change has to happen inside an animation.
Let content flow under the glass
Two more iOS 26 modifiers make the system's glass bars look their best:
TabView {
Tab("Library", systemImage: "books.vertical") { LibraryView() }
Tab("Search", systemImage: "magnifyingglass", role: .search) { SearchView() }
}
.tabBarMinimizeBehavior(.onScrollDown)tabBarMinimizeBehavior(.onScrollDown) shrinks the floating tab bar while people scroll down through content. backgroundExtensionEffect() mirrors and blurs an image beyond its edges, so hero artwork can extend under a sidebar or inspector without being cropped.
Supporting earlier iOS versions
If your app still supports iOS 18 or earlier, wrap the glass in a modifier with a material fallback, so call sites stay clean:
struct FloatingSurface<S: Shape>: ViewModifier {
var shape: S
func body(content: Content) -> some View {
if #available(iOS 26, *) {
content.glassEffect(.regular.interactive(), in: shape)
} else {
content.background(.ultraThinMaterial, in: shape)
}
}
}
extension View {
func floatingSurface<S: Shape>(in shape: S) -> some View {
modifier(FloatingSurface(shape: shape))
}
}A checklist before you ship
- Glass only on controls that float above content; content itself stays solid.
- One tinted, prominent action per screen.
- Grouped glass inside a
GlassEffectContainer. - Check it with Reduce Transparency and Increase Contrast turned on in Accessibility settings: the system swaps glass for frostier, higher-contrast versions, and your layout should still read.
- Check light mode, dark mode, and over your busiest content.
Make the rest of the app match
Glass is one layer. The surfaces, type and spacing under it decide whether an app feels designed. Effect UI's Prism style is a complete Liquid Glass design system for SwiftUI (a DESIGN.md, a Claude Code skill and reference screens), and if you build with an AI agent, here's how to give it a design system.