swiftui-liquid-glass

swiftui-liquid-glass

Populaire

Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.

1.4Kétoiles
82forks
Mis à jour 1/21/2026
SKILL.md
readonlyread-only
name
swiftui-liquid-glass
description

Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.

SwiftUI Liquid Glass

Overview

Use this skill to build or review SwiftUI features that fully align with the iOS 26+ Liquid Glass API. Prioritize native APIs (glassEffect, GlassEffectContainer, glass button styles) and Apple design guidance. Keep usage consistent, interactive where needed, and performance aware.

Workflow Decision Tree

Choose the path that matches the request:

1) Review an existing feature

  • Inspect where Liquid Glass should be used and where it should not.
  • Verify correct modifier order, shape usage, and container placement.
  • Check for iOS 26+ availability handling and sensible fallbacks.

2) Improve a feature using Liquid Glass

  • Identify target components for glass treatment (surfaces, chips, buttons, cards).
  • Refactor to use GlassEffectContainer where multiple glass elements appear.
  • Introduce interactive glass only for tappable or focusable elements.

3) Implement a new feature using Liquid Glass

  • Design the glass surfaces and interactions first (shape, prominence, grouping).
  • Add glass modifiers after layout/appearance modifiers.
  • Add morphing transitions only when the view hierarchy changes with animation.

Core Guidelines

  • Prefer native Liquid Glass APIs over custom blurs.
  • Use GlassEffectContainer when multiple glass elements coexist.
  • Apply .glassEffect(...) after layout and visual modifiers.
  • Use .interactive() for elements that respond to touch/pointer.
  • Keep shapes consistent across related elements for a cohesive look.
  • Gate with #available(iOS 26, *) and provide a non-glass fallback.

Review Checklist

  • Availability: #available(iOS 26, *) present with fallback UI.
  • Composition: Multiple glass views wrapped in GlassEffectContainer.
  • Modifier order: glassEffect applied after layout/appearance modifiers.
  • Interactivity: interactive() only where user interaction exists.
  • Transitions: glassEffectID used with @Namespace for morphing.
  • Consistency: Shapes, tinting, and spacing align across the feature.

Implementation Checklist

  • Define target elements and desired glass prominence.
  • Wrap grouped glass elements in GlassEffectContainer and tune spacing.
  • Use .glassEffect(.regular.tint(...).interactive(), in: .rect(cornerRadius: ...)) as needed.
  • Use .buttonStyle(.glass) / .buttonStyle(.glassProminent) for actions.
  • Add morphing transitions with glassEffectID when hierarchy changes.
  • Provide fallback materials and visuals for earlier iOS versions.

Quick Snippets

Use these patterns directly and tailor shapes/tints/spacing.

if #available(iOS 26, *) {
    Text("Hello")
        .padding()
        .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 16))
} else {
    Text("Hello")
        .padding()
        .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
}
GlassEffectContainer(spacing: 24) {
    HStack(spacing: 24) {
        Image(systemName: "scribble.variable")
            .frame(width: 72, height: 72)
            .font(.system(size: 32))
            .glassEffect()
        Image(systemName: "eraser.fill")
            .frame(width: 72, height: 72)
            .font(.system(size: 32))
            .glassEffect()
    }
}
Button("Confirm") { }
    .buttonStyle(.glassProminent)

Resources

  • Reference guide: references/liquid-glass.md
  • Prefer Apple docs for up-to-date API details.

You Might Also Like

Related Skills

cache-components

cache-components

137Kdev-frontend

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

vercel avatarvercel
Obtenir
component-refactoring

component-refactoring

128Kdev-frontend

Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.

langgenius avatarlanggenius
Obtenir
web-artifacts-builder

web-artifacts-builder

47Kdev-frontend

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

anthropics avataranthropics
Obtenir
frontend-design

frontend-design

47Kdev-frontend

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

anthropics avataranthropics
Obtenir
react-modernization

react-modernization

28Kdev-frontend

Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

wshobson avatarwshobson
Obtenir
tailwind-design-system

tailwind-design-system

28Kdev-frontend

Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

wshobson avatarwshobson
Obtenir