Dynamic, themeable, and fully SwiftUI-powered animated mesh gradients.
Add motion and color depth to your app’s backgrounds with ease.
AnimatedMesh brings live, evolving color gradients to SwiftUI using the new MeshGradient API.
It’s lightweight, theme-based, and completely customizable — perfect for creating ambient motion backgrounds, onboarding screens, and modern Apple-style visuals.
Think App Store icons, Apple Music auroras, or macOS Sonoma wallpapers — but made interactive and code-driven.
In Xcode:
- Go to File ▸ Add Packages...
- Enter the URL:
https://github.com/nsland/AnimatedMesh - Choose Add Package
Or manually in your Package.swift:
dependencies: [
.package(url: "https://github.com/nsland/AnimatedMesh", from: "1.0.0")
]Then import it:
import AnimatedMeshimport SwiftUI
import AnimatedMesh
struct ContentView: View {
var body: some View {
ZStack {
AnimatedMesh(theme: .auroraBlush)
.ignoresSafeArea()
VStack {
Text("Hello, Mesh!")
.font(.largeTitle)
.bold()
.foregroundStyle(.white)
}
}
}
}let customTheme = MeshGradientColorTheme(
width: 4,
height: 4,
meshColors: [
.blue, .purple, .cyan, .blue,
.purple, .cyan, .blue, .purple,
.cyan, .blue, .purple, .cyan,
.blue, .purple, .cyan, .blue
]
)Use it like this:
AnimatedMesh(theme: customTheme)| Theme | Description |
|---|---|
.auroraBlush |
Soft pinks, purples, and peaches for glowing backgrounds |
.dreamyPurple |
Serene lavender tones for calm, sleep-inspired UIs |
.moonlitViolet |
Deep blue-violet hues of a moonlit sky |
.twilightFlow |
Subtle purple gradients for elegant dark designs |
.auroraSleep |
Soothing purple and teal blend for tranquil animations |
.deepRest |
Muted purples for meditative or sleep apps |
.lavenderDream |
Gentle spa-like lavender tones |
.sunnyGold |
Bright golden and yellow hues for cheerful UIs |
.sunsetGlow |
Warm sunset reds and pinks |
.vibrantFlow |
Bold and dynamic palette for playful designs |
You can easily adjust:
widthandheight→ number of mesh grid columns/rowsmeshColors→ base colors of your theme
You can even create your own dynamic logic:
extension MeshGradientColorTheme {
static let oceanBreeze = MeshGradientColorTheme(
width: 3,
height: 3,
meshColors: [.blue, .teal, .mint, .cyan, .indigo, .blue, .mint, .cyan, .teal]
)
}AnimatedMesh is purely decorative.
If used as a background, mark it as hidden from accessibility:
.accessibilityHidden(true)| Platform | Minimum Version |
|---|---|
| iOS | 18.0 |
| macOS | 15.0 |
| tvOS | 18.0 |
| visionOS | 2.0 |
| watchOS | 11.0 |
- Requires Swift 6.2 or later
- Uses SwiftUI’s native
MeshGradientAPI
Licensed under the MIT License.
See LICENSE for details.
