Agent skills for iOS, iPadOS, Swift, SwiftUI, and modern Apple framework development.
90
90%
Does it follow best practices?
Impact
—
Average score across 248 eval scenarios
Advisory
Suggest reviewing before use
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.
Choose the path that matches the request:
GlassEffectContainer..glassEffect() after layout and appearance modifiers..interactive() only to tappable/focusable elements.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.if #available(iOS 26, *) and provide a fallback for earlier versions..glassEffect().GlassEffectContainer for blending and performance..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.Run through the Review Checklist below and verify each item.
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| Property / Method | Purpose |
|---|---|
.regular | Standard glass material |
.clear | Clear variant; add dimming/contrast treatment when legibility needs it |
.identity | No visual effect (pass-through) |
.tint(_:) | Add a color tint for prominence |
.interactive(_:) | React to touch and pointer interactions |
Chain them: .regular.tint(.blue).interactive()
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.
| Modifier | Purpose |
|---|---|
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("Action") { }
.buttonStyle(.glass) // standard glass button
Button("Primary") { }
.buttonStyle(.glassProminent) // prominent glass button
Button("Media") { }
.buttonStyle(.glass(.clear)) // configurable variant; verify contrastThese 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()Creates a visual break between items in toolbars:
.toolbar {
ToolbarItem { Button("Edit") { } }
ToolbarSpacer(.fixed)
ToolbarItem { Button("Share") { } }
}if #available(iOS 26, *) {
Button("Show Status") { showStatusDetails() }
.buttonStyle(.glass)
} else {
Button("Show Status") { showStatusDetails() }
.buttonStyle(.bordered)
}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()
}
}
}@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.
@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)
}
}
}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)))
}
}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.
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().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)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.
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()
}.interactive() adds visual affordance suggesting tappability. Using it on decorative
or read-only status glass misleads users.
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()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.
Liquid Glass requires iOS 26+. Gate with if #available(iOS 26, *) and provide a fallback.
if #available(iOS 26, *) present with fallback UI.GlassEffectContainer..glassEffect() applied after layout/appearance modifiers..interactive() used only where user interaction exists.glassEffectID used with @Namespace for morphing animations..matchedGeometry for nearby effects; .materialize for distant ones, applied to the conditional glass child..glass, .glassProminent, or configurable .glass(_:) used for buttons; .glass(_:) is primary when a tint or clear variant is required.glassEffectID / glassEffectUnion are Sendable; MainActor-annotated Liquid Glass APIs stay in SwiftUI UI code..tessl-plugin
skills
accessorysetupkit
references
activitykit
references
adattributionkit
references
alarmkit
references
app-clips
app-intents
references
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
references
audioaccessorykit
references
authentication
references
avkit
references
background-processing
references
browserenginekit
references
callkit
references
carplay
references
cloudkit
references
contacts-framework
references
core-bluetooth
references
core-data
core-motion
references
core-nfc
references
coreml
references
cryptokit
references
cryptotokenkit
references
debugging-instruments
device-integrity
references
dockkit
references
energykit
references
eventkit
references
financekit
references
focus-engine
gamekit
references
healthkit
references
homekit
references
ios-accessibility
ios-localization
ios-networking
ios-simulator
references
mapkit
metrickit
references
musickit
references
natural-language
references
paperkit
references
passkit
references
pdfkit
references
pencilkit
references
permissionkit
references
photokit
push-notifications
realitykit
references
relevancekit
references
scenekit
references
sensorkit
references
speech-recognition
references
spritekit
references
storekit
swift-api-design-guidelines
swift-architecture
swift-charts
references
swift-codable
swift-concurrency
swift-formatstyle
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-uikit-interop
swiftui-webkit
tabletopkit
references
tipkit
references
vision-framework
weatherkit
references
widgetkit
references