$npx -y skills add rshankras/claude-code-apple-skills --skill liquid-glassImplement Liquid Glass design using .glassEffect() API for iOS/macOS 26+. Covers SwiftUI, AppKit, UIKit, and WidgetKit. Use when creating modern glass-based UI effects.
| 1 | # Liquid Glass Design |
| 2 | |
| 3 | Implement Apple's Liquid Glass design language across all Apple UI frameworks. Covers SwiftUI (`.glassEffect()`), AppKit (`NSGlassEffectView`), UIKit (`UIGlassEffect` + `UIVisualEffectView`), and WidgetKit (rendering modes, accented content, glass elements in widgets). |
| 4 | |
| 5 | ## When This Skill Activates |
| 6 | |
| 7 | - User wants glass/blur effects on views |
| 8 | - User asks about Liquid Glass or modern Apple design |
| 9 | - User needs transparent, interactive UI elements |
| 10 | - User wants morphing transitions between views |
| 11 | - User is implementing glass effects in UIKit with `UIVisualEffectView` |
| 12 | - User needs `UIGlassEffect` or `UIGlassContainerEffect` |
| 13 | - User asks about scroll view edge effects in UIKit |
| 14 | - User wants Liquid Glass in widgets (WidgetKit) |
| 15 | - User needs to support accented rendering mode in widgets |
| 16 | - User asks about widget textures or mounting styles on visionOS |
| 17 | |
| 18 | ## Design Rules (WWDC25) |
| 19 | |
| 20 | Liquid Glass is the material of the **navigation layer** — bars, toolbars, floating controls — never the content layer (tables, lists, rows in a scroll view). |
| 21 | |
| 22 | | Rule | Detail | |
| 23 | |------|--------| |
| 24 | | **Never glass on glass** | Don't stack glass. Elements sitting ON glass don't get the material again — style them with fills and vibrancy. | |
| 25 | | **Two variants — never mix them** | **Regular** (default): works at any size, over anything, with adaptive legibility. **Clear**: only when ALL three hold — media-rich content underneath, a dimming layer is acceptable, and bold bright content sits above. Clear has no adaptive behaviors. One variant per interface. | |
| 26 | | **Tint only primary actions** | "When every element is tinted, nothing stands out." | |
| 27 | | **No steady-state intersections** | In resting layouts, content shouldn't sit half-under a glass element — reposition or scale the content instead. | |
| 28 | | **Strip decorated bars** | Remove customized bar backgrounds and borders; build hierarchy through layout and grouping, not decoration. Never group a symbol with a text label in one toolbar group. Action sheets spring from their source element. | |
| 29 | |
| 30 | **Scroll edge effects** keep floating elements separated from scrolling content: soft (gradual fade — the iOS default) vs hard (denser, with a dividing line — mostly macOS). One per view edge, and they're not decorative — don't add one where no floating UI elements exist. |
| 31 | |
| 32 | **Shape system** — let containers do the math: |
| 33 | |
| 34 | | Shape | Radius | Use | |
| 35 | |-------|--------|-----| |
| 36 | | Fixed | Constant | Standalone elements | |
| 37 | | Capsule | Half the element height | Phone-scale controls — add extra margin from the screen edge | |
| 38 | | Concentric | Parent radius minus padding | Nested containers (inner radii auto-calculate); iPad/Mac elements concentric with the window edge | |
| 39 | |
| 40 | **Accessibility comes free at the system level**: Reduced Motion decreases lensing and elastic effects; Increased Contrast renders glass elements black/white with a contrasting border. (Lensing is how glass appears — it materializes by modulating how it bends light, and adaptive shadows flip small elements light/dark for legibility over any content.) |
| 41 | |
| 42 | ## Quick Start (SwiftUI) |
| 43 | |
| 44 | ### Basic Glass Effect |
| 45 | |
| 46 | ```swift |
| 47 | import SwiftUI |
| 48 | |
| 49 | Text("Hello, World!") |
| 50 | .font(.title) |
| 51 | .padding() |
| 52 | .glassEffect() // Capsule shape by default |
| 53 | ``` |
| 54 | |
| 55 | ### Custom Shape |
| 56 | |
| 57 | ```swift |
| 58 | Text("Hello") |
| 59 | .padding() |
| 60 | .glassEffect(in: .rect(cornerRadius: 16)) |
| 61 | |
| 62 | // Available shapes: |
| 63 | // .capsule (default) |
| 64 | // .rect(cornerRadius: CGFloat) |
| 65 | // .rect(corner: .containerConcentric) — radius derived from the container, keeps nested shapes concentric |
| 66 | // .circle |
| 67 | ``` |
| 68 | |
| 69 | ### Interactive Glass |
| 70 | |
| 71 | ```swift |
| 72 | Button("Tap Me") { |
| 73 | // action |
| 74 | } |
| 75 | .padding() |
| 76 | .glassEffect(.regular.interactive()) |
| 77 | ``` |
| 78 | |
| 79 | ### Tinted Glass |
| 80 | |
| 81 | ```swift |
| 82 | Text("Important") |
| 83 | .padding() |
| 84 | .glassEffect(.regular.tint(.blue)) |
| 85 | ``` |
| 86 | |
| 87 | ## Glass Configuration Options |
| 88 | |
| 89 | | Option | Description | Example | |
| 90 | |--------|-------------|---------| |
| 91 | | `.regular` | Standard glass effect | `.glassEffect(.regular)` | |
| 92 | | `.tint(Color)` | Add color tint | `.glassEffect(.regular.tint(.orange))` | |
| 93 | | `.interactive()` | Scale, bounce, and shimmer on touch/hover | `.glassEffect(.regular.interactive())` | |
| 94 | |
| 95 | ## Multiple Glass Effects |
| 96 | |
| 97 | ### GlassEffectContainer |
| 98 | |
| 99 | When using multiple glass elements, wrap them in `GlassEffectContainer` for: |
| 100 | - Better rendering performance |
| 101 | - Proper blending between effects |
| 102 | - Morphing transitions |
| 103 | |
| 104 | This is correctness, not just performance: glass can not sample other glass, so nearby glass elements must share ONE container to render and blend correctly. |
| 105 | |
| 106 | ```swift |
| 107 | GlassEffectContainer(spacing: 40.0) { |
| 108 | HStack(spacing: 40.0) { |
| 109 | Image(systemName: "star.fill") |
| 110 | .frame(width: 80, heigh |