Liquid glass

From fanfan-de/anybox · View interactive version

Liquid glass is an AI agent skill from the GitHub repository fanfan-de/anybox. Implement and review macOS SwiftUI Liquid Glass UI. Use when adopting system glass, removing conflicting custom chrome, or building glass surfaces.

How to use this skill

Skill file

Liquid Glass

Overview

Use this skill to bring a macOS SwiftUI app into the modern macOS design system

with the least custom chrome possible. Start with standard app structure,

toolbars, search placement, sheets, and controls, then add custom Liquid Glass

only where the app needs a distinctive surface.

Prefer system-provided glass and adaptive materials over bespoke blur, opaque

backgrounds, or custom toolbar/sidebar skins. Audit existing UI for extra fills,

scrims, and clipping before adding more effects.

Workflow

  1. Read the relevant scene or root view and identify the structural pattern:

NavigationSplitView, TabView, sheet presentation, detail/inspector

layout, toolbar, or custom floating controls.

  1. Remove custom backgrounds or darkening layers behind system sheets,

sidebars, and toolbars unless the product explicitly needs them. These can

obscure Liquid Glass and interfere with the automatic scroll-edge effect.

  1. Update standard SwiftUI structure and controls first.
  2. Add custom glassEffect surfaces only for app-specific UI that standard

controls do not cover.

  1. Validate that glass grouping, transitions, icon treatment, and foreground

activation are visually coherent and still usable with pointer and keyboard.

  1. If the UI change also affects launch behavior for a SwiftPM GUI app, use

build-run-debug so the app runs as a foreground .app bundle rather

than as a raw executable.

App Structure

sidebar use the system Liquid Glass material instead of painting over it.

backgroundExtensionEffect so the visual can extend beyond the safe area

without clipping the subject.

giving them a heavier custom background than the content they inspect.

preserve each tab's local navigation state.

On macOS, prefer a conventional top toolbar and native tab/search placement.

material, consider removing it and letting the system's new material render.

make the presenting item the source of a navigation zoom transition and mark

the sheet content as the destination.

Toolbars

grouped automatically.

shared glass background, for example a profile/avatar item.

convey semantic meaning such as a primary action or alert state, not as pure

decoration.

background layers, remove them before judging the new automatic scroll-edge

effect.

treatment with scrollEdgeEffectStyle instead of building a custom bar

background.

Search

searchable to the NavigationSplitView, not to just one column.

searchToolbarBehavior instead of hand-rolling a toolbar button and a

separate field.

tab and place searchable on the TabView.

in the top-trailing toolbar location.

above browsing suggestions rather than a bottom search bar.

Controls

macOS, mini/small/medium controls preserve a rounded-rectangle shape for

denser layouts.

extra-large sizing for truly prominent actions.

instead of recreating a translucent button background by hand.

provide specific ticks in a ticks closure.

neutralValue.

consistently placed on the leading edge across platforms.

window corner, use a concentric rectangle shape with the

containerConcentric corner configuration instead of guessing a radius.

Custom Liquid Glass

and text foregrounds are automatically made vibrant and legible against

changing content underneath.

action.

interactive elements so they scale, bounce, and shimmer like system glass.

visual correctness rule, not just organization: separate containers cannot

sample each other's glass and can produce inconsistent refraction.

should morph between collapsed and expanded states.

Review Checklist

glass.

system material were removed unless intentionally required.

search scope.

badge instead of one-off hand-built chrome.

GlassEffectContainer.

identity.

not as a raw executable.

Guardrails

standard SwiftUI APIs already provide the modern macOS behavior.

sidebar, system toolbar, or sheet just because an older version needed

one.

GlassEffectContainers.

Prefer desktop-native toolbar, split-view, and inspector placement.

Liquid Glass behavior; missing foreground activation can make a design bug

look like a rendering bug.

When To Use Other Skills

sidebar/detail layout, commands, or settings rather than Liquid Glass-specific

treatment.

ownership, and extracting large views before design changes.

or AppKit-only control behavior.

for the app after the visual update.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.