soft-glass-ui
Skill0 starsChanged 9 months agoMITView on GitHub
Design system for creating premium glass UI using iOS 26 native Liquid Glass APIs (.glassEffect modifier) or fallback gradient-based approaches for older iOS versions. Use when building SwiftUI iOS apps with glassmorphism, premium UI, translucent cards, or modern Apple-style interfaces. Triggers on requests for liquid glass, glassmorphism, iOS 26 design, premium UI, or translucent interfaces.
In this repository13 other files it gives its agents.
- agent-browserSkill
- bunny-netSkill
- changelogSkill
- company-researchSkill
- fikenSkill
- google-deep-researchSkill
- instagram-pipelineSkill
- ios-developmentSkill
- klarsprakSkill
- parallel-researchSkill
- transcribeSkill
- transparency-generationSkill
- world-buildingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 73
Glass needs something to sample: Create rich backgrounds:
- Distinctive: line 116
When targeting older iOS versions, use gradient-based glass:
- Distinctive: line 189
Use rounded font design throughout:
- Distinctive: line 210
Use light text on dark backgrounds:
- Distinctive: line 228
Use dark text on light backgrounds:
- Very specific: line 271
Use .interactive() on buttons for native touch animations:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Glass UI Design System
A comprehensive design system for creating premium glass interfaces. Supports iOS 26+ native Liquid Glass (glassEffect) and provides fallback patterns for iOS 17-18.
Critical Insight: iOS 26 Liquid Glass
The "glass" effect in iOS 26 is NOT gradients and shadows. It's a physically-accurate lensing system that samples the background and creates real-time refraction effects.
What This Means:
- Glass needs colorful/dark backgrounds - Unlike gradient-based glass that works on any background, native liquid glass samples what's behind it. On a plain white background, glass appears nearly invisible.
- Use
.ultraThinMaterial+.glassEffect()- The material provides the frosted base, the glassEffect adds the liquid refraction. - Interactive feedback is built-in -
.glassEffect(.regular.interactive())provides touch scaling/bouncing animations automatically.
iOS Version Strategy
| iOS Version | Approach |
| iOS 26+ | Native .glassEffect() modifier with .ultraThinMaterial |
| iOS 17-18 | Gradient-based fallback with .ultraThinMaterial or custom gradients |
iOS 26 Native Liquid Glass
The Core Pattern
// The iOS 26 glass pattern
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
.glassEffect(.regular, in: RoundedRectangle(cornerRadius: 16))Glass Effect Variants
| Variant | Usage |
.regular | Standard glass for cards, containers |
.regular.tint(color) | Adds color tint to the glass |
.regular.interactive() | Enables touch feedback animations |
.clear | More transparent, for media-rich backgrounds |
Example: Glass Button
Button(action: action) {
HStack {
Image(systemName: "play.fill")
Text("Start")
}
.padding()
.foregroundStyle(.white)
.background(LinearGradient.brandGradient)
.clipShape(RoundedRectangle(cornerRadius: 16))
.glassEffect(
.regular.tint(.brandPrimary).interactive(),
in: RoundedRectangle(cornerRadius: 16)
)
}Background Requirements
Glass needs something to sample. Create rich backgrounds:
// Rich gradient background for glass to sample
struct BrandBackgroundModifier: ViewModifier {
func body(content: Content) -> some View {
content
.background {
ZStack {
// Deep base color
Color(hex: "0A0A1A")
// Animated gradient orbs
Circle()
.fill(RadialGradient(
colors: [.brandPrimary.opacity(0.4), .clear],
center: .center,
startRadius: 0,
endRadius: 200
))
.frame(width: 400, height: 400)
.offset(x: -100, y: -150)
Circle()
.fill(RadialGradient(
colors: [.brandSecondary.opacity(0.3), .clear],
center: .center,
startRadius: 0,
endRadius: 180
))
.frame(width: 360, height: 360)
.offset(x: 120, y: 200)
}
.ignoresSafeArea()
}
}
}Fallback for iOS 17-18
When targeting older iOS versions, use gradient-based glass:
struct GlassCardFallback<Content: View>: View {
let content: Content
var body: some View {
content
.padding(24)
.background(
LinearGradient(
colors: [.white, Color.surfaceWarm.opacity(0.3)],
startPoint: .top,
endPoint: .bottom
)
)
.clipShape(RoundedRectangle(cornerRadius: 16))
.shadow(color: .black.opacity(0.08), radius: 10, y: 4)
}
}Availability Check Pattern
struct GlassCard<Content: View>: View {
let content: Content
var body: some View {
if #available(iOS 26.0, *) {
content
.padding(24)
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
.glassEffect(.regular, in: RoundedRectangle(cornerRadius: 16))
} else {
content
.padding(24)
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 16))
}
}
}Design Tokens
Spacing Scale (8pt base)
xs: 4 s: 8 m: 16 l: 24 xl: 32 xxl: 48Corner Radius Scale
small: 8 medium: 12 large: 16 xl: 24Animation Timings
fast: 0.3s spring(response: 0.3, dampingFraction: 0.7)
standard: 0.5s spring
slow: 1.0s spring
stagger-delay: 0.05s per itemTypography
Use rounded font design throughout:
.font(.system(size: 16, weight: .medium, design: .rounded))| Style | Size | Weight |
| hero | 48-56 | bold/heavy |
| title | 28 | bold |
| headline | 20 | semibold |
| body | 16 | medium |
| caption | 14 | medium |
| small | 12 | regular |
Color Strategy
For iOS 26 Liquid Glass
Use light text on dark backgrounds:
extension Color {
// Text (white-based for dark backgrounds)
static var brandText: Color { .white }
static var brandTextSecondary: Color { .white.opacity(0.7) }
static var brandTextMuted: Color { .white.opacity(0.5) }
// Accent colors (vibrant for glass tinting)
static var brandPrimary: Color { Color(hex: "6366F1") } // Indigo
static var brandAccent: Color { Color(hex: "10B981") } // Emerald
static var brandSecondary: Color { Color(hex: "8B5CF6") } // Purple
}For Fallback (Light Mode)
Use dark text on light backgrounds:
extension Color {
static var brandText: Color { Color(hex: "1E293B") }
static var surfaceWarm: Color { Color(hex: "FDF8F3") } // Warm cream
}Key Components
See references/components.md for detailed implementations:
- GlassButton - Primary actions with glass + gradient
- GlassCard - Container with glass background
- GlassSelectionCard - Selectable cards with tinted glass
- GlassProgressRing - Timer/progress with glass track
- GlassToast - Notification overlays
- GlassIconCircle - Icon badges with glass background
Common Mistakes to Avoid
1. Using glass on white/plain backgrounds
Glass needs something to refract. Plain backgrounds make glass invisible.
2. Forgetting the shape parameter
.glassEffect requires a shape:
// Wrong
.glassEffect(.regular)
// Correct
.glassEffect(.regular, in: RoundedRectangle(cornerRadius: 16))3. Using gradients instead of materials on iOS 26
The native glass effect looks better than any gradient approximation.
4. Not providing interactive feedback
Use .interactive() on buttons for native touch animations:
.glassEffect(.regular.interactive(), in: RoundedRectangle(cornerRadius: 16))Quick Reference
iOS 26 Glass Card:
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
.glassEffect(.regular, in: RoundedRectangle(cornerRadius: 16))iOS 26 Tinted Glass:
.glassEffect(.regular.tint(.brandPrimary), in: RoundedRectangle(cornerRadius: 16))iOS 26 Interactive Button:
.glassEffect(.regular.tint(.accent).interactive(), in: RoundedRectangle(cornerRadius: 16))Deployment Target: Set to iOS 26.0 to use native .glassEffect() API.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

