PluginBench
Skill
Pass
Audit score 90

liquid-glass-design

affaan-m/ecc

iOS 26 Liquid Glass design system with dynamic blur, reflection, and interactive morphing for SwiftUI, UIKit, and WidgetKit.

What is liquid-glass-design?

A design system for implementing Apple's Liquid Glass material—a dynamic, blurred glass effect that reflects surrounding content and reacts to touch. Use it when building or updating apps for iOS 26+ that need modern glass-style UI elements like buttons, cards, and containers.

  • Apply glass effects to SwiftUI views with `.glassEffect()` modifier and customizable tints, shapes, and interactivity
  • Create morphing transitions between glass elements using `@Namespace` and `glassEffectID` for smooth view hierarchy changes
  • Wrap multiple glass views in `GlassEffectContainer` for performance optimization and automatic element blending
  • Implement glass effects in UIKit via `UIGlassEffect` and `UIGlassContainerEffect` with tint and interactivity control
  • Support WidgetKit rendering with accent groups, monochrome image modes, and container backgrounds for tinted Home Screens
  • Configure scroll edge effects and toolbar glass integration in UIKit with fine-grained style control

How to install liquid-glass-design

npx skills add null --skill liquid-glass-design
Prerequisites
  • iOS 26+ deployment target
  • SwiftUI, UIKit, or WidgetKit framework (depending on use case)
Claude Code
Cursor
Windsurf
Cline

How to use liquid-glass-design

  1. 1.Import the Liquid Glass design system into your project
  2. 2.For SwiftUI: apply `.glassEffect()` modifier to views, optionally customize with `.tint()`, `.interactive()`, and shape parameters
  3. 3.For multiple glass elements: wrap them in `GlassEffectContainer` with appropriate spacing to control blending behavior
  4. 4.For morphing transitions: define a `@Namespace`, assign `glassEffectID` to elements, and use `withAnimation` when toggling view visibility
  5. 5.For UIKit: create `UIGlassEffect` or `UIGlassContainerEffect` instances, wrap in `UIVisualEffectView`, and add to view hierarchy
  6. 6.For WidgetKit: check `@Environment(\widgetRenderingMode)` to conditionally apply accent groups and rendering modes

Use cases

Good for
  • Building glass-style buttons and prominent button variants with `.buttonStyle(.glass)` and `.buttonStyle(.glassProminent)`
  • Creating morphing toolbar or card layouts that smoothly expand/collapse glass elements on user interaction
  • Implementing widget UI that adapts to tinted vs. full-color rendering modes with accent groups and conditional styling
  • Designing interactive glass containers with controlled spacing to blend or separate multiple glass elements
  • Migrating existing blur and material effects to the new Liquid Glass API for iOS 26+ consistency
Who it's for
  • iOS app developers targeting iOS 26+ with modern design language requirements
  • SwiftUI developers building interactive glass UI components and morphing transitions
  • UIKit developers integrating glass effects into existing view hierarchies and toolbars
  • Widget developers adapting UI for tinted Home Screen rendering modes
  • Design system maintainers standardizing glass material patterns across an app

liquid-glass-design FAQ

When should I use GlassEffectContainer vs. applying .glassEffect() directly?

Always use GlassEffectContainer when applying glass to multiple sibling views—it enables morphing and improves rendering performance. For single views, .glassEffect() alone is sufficient.

How do I control when glass elements merge together?

Use the `spacing` parameter in GlassEffectContainer—it controls the merge distance. Closer elements blend their glass shapes together; adjust spacing to fine-tune when merging occurs.

What's the difference between .glassEffect() and .glassEffect(.interactive())?

.interactive() enables touch and pointer reactions; use it only on interactive elements like buttons or toggleable items. Not all glass should respond to interaction.

How do I create smooth morphing when glass elements appear or disappear?

Define a @Namespace, assign glassEffectID to each element, wrap in GlassEffectContainer, and use withAnimation when changing view visibility—the system handles the morphing automatically.

How do WidgetKit widgets adapt to tinted Home Screen rendering?

Check @Environment(\.widgetRenderingMode) to detect accented (tinted) mode. Use .widgetAccentable() to mark elements for tinting, and .widgetAccentedRenderingMode(.monochrome) for images in tinted mode.

Full instructions (SKILL.md)

Source of truth, from affaan-m/ecc.


name: liquid-glass-design description: iOS 26 Liquid Glass design system — dynamic glass material with blur, reflection, and interactive morphing for SwiftUI, UIKit, and WidgetKit.

Liquid Glass Design System (iOS 26)

Patterns for implementing Apple's Liquid Glass — a dynamic material that blurs content behind it, reflects color and light from surrounding content, and reacts to touch and pointer interactions. Covers SwiftUI, UIKit, and WidgetKit integration.

When to Activate

  • Building or updating apps for iOS 26+ with the new design language
  • Implementing glass-style buttons, cards, toolbars, or containers
  • Creating morphing transitions between glass elements
  • Applying Liquid Glass effects to widgets
  • Migrating existing blur/material effects to the new Liquid Glass API

Core Pattern — SwiftUI

Basic Glass Effect

The simplest way to add Liquid Glass to any view:

Text("Hello, World!")
    .font(.title)
    .padding()
    .glassEffect()  // Default: regular variant, capsule shape

Customizing Shape and Tint

Text("Hello, World!")
    .font(.title)
    .padding()
    .glassEffect(.regular.tint(.orange).interactive(), in: .rect(cornerRadius: 16.0))

Key customization options:

  • .regular — standard glass effect
  • .tint(Color) — add color tint for prominence
  • .interactive() — react to touch and pointer interactions
  • Shape: .capsule (default), .rect(cornerRadius:), .circle

Glass Button Styles

Button("Click Me") { /* action */ }
    .buttonStyle(.glass)

Button("Important") { /* action */ }
    .buttonStyle(.glassProminent)

GlassEffectContainer for Multiple Elements

Always wrap multiple glass views in a container for performance and morphing:

GlassEffectContainer(spacing: 40.0) {
    HStack(spacing: 40.0) {
        Image(systemName: "scribble.variable")
            .frame(width: 80.0, height: 80.0)
            .font(.system(size: 36))
            .glassEffect()

        Image(systemName: "eraser.fill")
            .frame(width: 80.0, height: 80.0)
            .font(.system(size: 36))
            .glassEffect()
    }
}

The spacing parameter controls merge distance — closer elements blend their glass shapes together.

Uniting Glass Effects

Combine multiple views into a single glass shape with glassEffectUnion:

@Namespace private var namespace

GlassEffectContainer(spacing: 20.0) {
    HStack(spacing: 20.0) {
        ForEach(symbolSet.indices, id: \.self) { item in
            Image(systemName: symbolSet[item])
                .frame(width: 80.0, height: 80.0)
                .glassEffect()
                .glassEffectUnion(id: item < 2 ? "group1" : "group2", namespace: namespace)
        }
    }
}

Morphing Transitions

Create smooth morphing when glass elements appear/disappear:

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

GlassEffectContainer(spacing: 40.0) {
    HStack(spacing: 40.0) {
        Image(systemName: "scribble.variable")
            .frame(width: 80.0, height: 80.0)
            .glassEffect()
            .glassEffectID("pencil", in: namespace)

        if isExpanded {
            Image(systemName: "eraser.fill")
                .frame(width: 80.0, height: 80.0)
                .glassEffect()
                .glassEffectID("eraser", in: namespace)
        }
    }
}

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

Extending Horizontal Scrolling Under Sidebar

To allow horizontal scroll content to extend under a sidebar or inspector, ensure the ScrollView content reaches the leading/trailing edges of the container. The system automatically handles the under-sidebar scrolling behavior when the layout extends to the edges — no additional modifier is needed.

Core Pattern — UIKit

Basic UIGlassEffect

let glassEffect = UIGlassEffect()
glassEffect.tintColor = UIColor.systemBlue.withAlphaComponent(0.3)
glassEffect.isInteractive = true

let visualEffectView = UIVisualEffectView(effect: glassEffect)
visualEffectView.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.layer.cornerRadius = 20
visualEffectView.clipsToBounds = true

view.addSubview(visualEffectView)
NSLayoutConstraint.activate([
    visualEffectView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
    visualEffectView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
    visualEffectView.widthAnchor.constraint(equalToConstant: 200),
    visualEffectView.heightAnchor.constraint(equalToConstant: 120)
])

// Add content to contentView
let label = UILabel()
label.text = "Liquid Glass"
label.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.contentView.addSubview(label)
NSLayoutConstraint.activate([
    label.centerXAnchor.constraint(equalTo: visualEffectView.contentView.centerXAnchor),
    label.centerYAnchor.constraint(equalTo: visualEffectView.contentView.centerYAnchor)
])

UIGlassContainerEffect for Multiple Elements

let containerEffect = UIGlassContainerEffect()
containerEffect.spacing = 40.0

let containerView = UIVisualEffectView(effect: containerEffect)

let firstGlass = UIVisualEffectView(effect: UIGlassEffect())
let secondGlass = UIVisualEffectView(effect: UIGlassEffect())

containerView.contentView.addSubview(firstGlass)
containerView.contentView.addSubview(secondGlass)

Scroll Edge Effects

scrollView.topEdgeEffect.style = .automatic
scrollView.bottomEdgeEffect.style = .hard
scrollView.leftEdgeEffect.isHidden = true

Toolbar Glass Integration

let favoriteButton = UIBarButtonItem(image: UIImage(systemName: "heart"), style: .plain, target: self, action: #selector(favoriteAction))
favoriteButton.hidesSharedBackground = true  // Opt out of shared glass background

Core Pattern — WidgetKit

Rendering Mode Detection

struct MyWidgetView: View {
    @Environment(\.widgetRenderingMode) var renderingMode

    var body: some View {
        if renderingMode == .accented {
            // Tinted mode: white-tinted, themed glass background
        } else {
            // Full color mode: standard appearance
        }
    }
}

Accent Groups for Visual Hierarchy

HStack {
    VStack(alignment: .leading) {
        Text("Title")
            .widgetAccentable()  // Accent group
        Text("Subtitle")
            // Primary group (default)
    }
    Image(systemName: "star.fill")
        .widgetAccentable()  // Accent group
}

Image Rendering in Accented Mode

Image("myImage")
    .widgetAccentedRenderingMode(.monochrome)

Container Background

VStack { /* content */ }
    .containerBackground(for: .widget) {
        Color.blue.opacity(0.2)
    }

Key Design Decisions

DecisionRationale
GlassEffectContainer wrappingPerformance optimization, enables morphing between glass elements
spacing parameterControls merge distance — fine-tune how close elements must be to blend
@Namespace + glassEffectIDEnables smooth morphing transitions on view hierarchy changes
interactive() modifierExplicit opt-in for touch/pointer reactions — not all glass should respond
UIGlassContainerEffect in UIKitSame container pattern as SwiftUI for consistency
Accented rendering mode in widgetsSystem applies tinted glass when user selects tinted Home Screen

Best Practices

  • Always use GlassEffectContainer when applying glass to multiple sibling views — it enables morphing and improves rendering performance
  • Apply .glassEffect() after other appearance modifiers (frame, font, padding)
  • Use .interactive() only on elements that respond to user interaction (buttons, toggleable items)
  • Choose spacing carefully in containers to control when glass effects merge
  • Use withAnimation when changing view hierarchies to enable smooth morphing transitions
  • Test across appearances — light mode, dark mode, and accented/tinted modes
  • Ensure accessibility contrast — text on glass must remain readable

Anti-Patterns to Avoid

  • Using multiple standalone .glassEffect() views without a GlassEffectContainer
  • Nesting too many glass effects — degrades performance and visual clarity
  • Applying glass to every view — reserve for interactive elements, toolbars, and cards
  • Forgetting clipsToBounds = true in UIKit when using corner radii
  • Ignoring accented rendering mode in widgets — breaks tinted Home Screen appearance
  • Using opaque backgrounds behind glass — defeats the translucency effect

When to Use

  • Navigation bars, toolbars, and tab bars with the new iOS 26 design
  • Floating action buttons and card-style containers
  • Interactive controls that need visual depth and touch feedback
  • Widgets that should integrate with the system's Liquid Glass appearance
  • Morphing transitions between related UI states