open-swiftui-animations: Pure SwiftUI Animation Examples Without a Library
You don't need an animation library to add a simple effect to your SwiftUI app. Create it yourself with SwiftUI. This repo inspires you to add helpful and expressive SwiftUI animations like loading/progress, looping, on-off, enter, exit, fade, spin, and background animations to your next project. The repo also contains tremendous spring animations.
At a glance
- What is it?
- open-swiftui-animations is a collection of pure SwiftUI animation code for iOS, macOS, visionOS, and watchOS developers who want to build effects without adding an external dependency. The repository contains an Xcode project with ready-to-browse examples covering spring, phase, keyframe, and symbol animations.
- Who is it for?
- open-swiftui-animations is the right resource for SwiftUI developers who want to understand how specific effects are built and adapt the code to their own apps without taking on a third-party dependency. It is the wrong choice for developers who need production-ready animations with accessibility hooks, fallback behaviors for older iOS versions, or a documented API.
- Can I use it commercially?
- Yes. Unlicense is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 45 days ago.
- What is it written in?
- Mainly Swift, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
A Code Example Repository for SwiftUI Animation
open-swiftui-animations is not an animation library. It is a collection of SwiftUI code examples that developers can read, run, and adapt. The premise stated in the README is that you should not need a third-party animation library to add a simple effect to a SwiftUI app, and that writing the animation yourself from native SwiftUI APIs is a viable and educational path.
The project targets developers building for iOS, macOS, visionOS, and watchOS. The examples are distributed as a single Xcode project (OpenSwiftUIAnimations.xcodeproj) rather than a package that you import. You open the project, navigate to the example you want, read the code, and copy or adapt it into your own project.
The README states that most animations here are based on the animations section in the Apple Developer Documentation. This means the examples are closely tied to Apple's documented APIs rather than custom rendering code. The practical benefit is that the techniques you learn from this repository are the same techniques Apple describes in its own documentation.
What the Repository Contains
The top-level structure has four main components. OpenSwiftUIAnimations/ contains the Swift source files. OpenSwiftUIAnimations.xcodeproj is the Xcode project file. Gists_To_Try/ contains standalone Swift files that can be tried individually. GIF_Previews/ contains preview animations for the README.
The categories of animations described in the README include loading and progress indicators, looping effects, enter and exit transitions, fade effects, spin animations, background animations, and spring animations. The README notes the repository contains what it describes as tremendous spring animations, which matches the Apple SwiftUI Spring API coverage that was expanded starting in iOS 17.
Specific named examples visible in the README include a typewriting, erasing, and cursor-blinking animation, a Safari-style add-to-bookmarks animation, a New Year's Eve fireworks effect (NewYearsEveFireworks2026.swift), a pulsing hearts animation (PulsingHearts.swift), a slide-to-unlock animation (SlideToUnlock.swift), a cross-fade numeric transition (CrossFadeNumericTransition.swift), and a Vision Pro 3D rotation example. The Gists_To_Try/ directory also contains files like MaskClippedClipShape.swift for animated visual guides to specific SwiftUI modifiers.
Using the Examples: Clone, Browse, Adapt
Since open-swiftui-animations is not a Swift package, there is no package import step. The usage path is to clone the repository, open the Xcode project, and navigate to the example you want.
The README shows an example for the Liquid Glass Shape Morphing Animation that demonstrates GlassEffectContainer and PhaseAnimator working together.
import SwiftUI
struct LiquidGlassEffectContainer: View {
var body: some View {
GlassEffectContainer(spacing: 50) {
PhaseAnimator([false, true]) { morph in
HStack(spacing: morph ? 50.0 : -15.0) {This snippet shows the PhaseAnimator receiving an array of two states (false and true) and animating the HStack spacing between -15 points and 50 points as the phase cycles. The GlassEffectContainer provides the Liquid Glass visual context. This example requires visionOS or a platform that supports GlassEffectContainer.
For animations that do not require a full Xcode project, the README links to individual Gist files for effects like the typewriting animation (TypingErasing.swift), the bookmark animation (AddToBookmark.swift), and the flower rotation (FlowerAnimation.swift). These can be copied directly without opening the Xcode project.
Spring Animations, Phase Animator, and iOS 17 APIs
The README explicitly calls out the newer SwiftUI APIs introduced for iOS 17 and later. Phase Animator, Keyframe Animator, Symbol Effects, and the Spring animation type are all covered. These APIs represent Apple's preferred approach to complex multi-step animations without writing custom CAAnimation code.
PhaseAnimator cycles through a sequence of discrete states with animations between each transition. KeyframeAnimator defines complex motion paths with timing curves for individual properties. Both are documented in Apple's developer documentation, and the examples in this repository show how to apply them to practical UI patterns like reactions, icon transitions, and content swaps.
Spring animations receive particular coverage. The README mentions Reactions with Springs and Expressive Reactions with file references to specific Swift files. Spring-based animations in SwiftUI model physical spring behavior with parameters for bounce, duration, and damping rather than raw timing curves, which produces more natural-feeling motion than easing functions.
Symbol Effects animate SF Symbols with built-in transitions like variable color, pulse, and bounce, which are also demonstrated in the repository. The IncomingCall.swift Gist linked in the README uses a symbol effect with variable color and hue rotation combined, showing how multiple effects compose on a single symbol.
Where This Collection Falls Short
open-swiftui-animations does not provide production-ready components. The examples show how animations work; they do not handle edge cases such as reduced-motion accessibility settings, state restoration during interruptions, or graceful fallbacks for older OS versions. A developer copying an example into a shipping app is responsible for adding those considerations.
The README notes that starting in 2025, some animations are generated by AI models including Gemini 2.5 Pro, Claude 3.7 Sonnet, OpenAI o3, and o4-mini, and that those additions are unedited. The README explicitly recommends modifying them to suit your needs. This means the AI-generated examples may contain patterns that work visually but are not optimally structured or do not follow SwiftUI best practices.
The repository has no GitHub releases and no versioning scheme. Code examples do not come with any guarantee of API stability. If Apple changes a SwiftUI API that an example depends on, the example will stop compiling without a corresponding update to the repository.
For visionOS and watchOS targets, the README does not specify which examples are tested on those platforms versus which are listed as supported in principle. The 3D rotation and GlassEffectContainer examples specifically require hardware or simulators that are not available in all development environments.
open-swiftui-animations vs. Lottie: Native Code vs. External Files
Lottie is an open-source animation library from Airbnb that renders JSON-based animation files produced by After Effects or similar design tools. The fundamental difference from open-swiftui-animations is the workflow. Lottie animations are designed outside Xcode in a motion design tool and exported as JSON files that the Lottie runtime renders at playback time. open-swiftui-animations animations are written entirely in Swift and SwiftUI with no external files.
The choice between the two depends on who is creating the animation. If a motion designer produces animation files using After Effects and hands them off to developers, Lottie handles that workflow. If a developer is writing animations directly in code without a designer handoff, the native SwiftUI approach demonstrated in open-swiftui-animations avoids adding Lottie as a dependency.
A practical constraint with Lottie is that complex animations from design tools may use features that Lottie's renderer does not fully support, requiring the designer to work within the subset that Lottie handles correctly. The SwiftUI animations in this repository are bounded by what SwiftUI itself supports, which is entirely documented by Apple and guaranteed to work on the target platforms.
Licence, Maintenance, and AI-Assisted Contributions
open-swiftui-animations is released under the Unlicense, which is a public domain dedication. There are no attribution requirements. You can copy, modify, and use any code from the repository in any project, including commercial apps, without crediting the source.
The last push to the repository was on 2026-08-14, which is within the past six weeks relative to this writing. The project has no GitHub releases. The README does not document a changelog. Updates appear as commits to the master branch.
The repository owner, Amos Gyamfi, accepts requests for new animations through X at @amos_gyamfi and through a GitHub project backlog linked in the README. This makes the repository somewhat collaborative: developers who want a specific animation they do not see can submit a request rather than only consuming what is already there.
The note about AI-generated animations starting in 2025 adds a new category of examples to the repository. The explicit label in the README that those examples are unedited is useful context for developers who want to understand which examples went through a human review and which did not before they decide how much to rely on them as reference implementations.
Editorial conclusion
open-swiftui-animations is the right resource for SwiftUI developers who want to understand how specific effects are built and adapt the code to their own apps without taking on a third-party dependency. It is the wrong choice for developers who need production-ready animations with accessibility hooks, fallback behaviors for older iOS versions, or a documented API. The Unlicense dedication means there are no attribution requirements when you copy code into your own project. Before using any example, check that the SwiftUI APIs it uses are available on your minimum deployment target, since the PhaseAnimator, KeyframeAnimator, and GlassEffectContainer APIs require iOS 17 or visionOS, and the README notes that starting in 2025 some additions are AI-generated and unedited.
Frequently asked questions
Does open-swiftui-animations work as an installable Swift Package Manager package?
The repository is distributed as an Xcode project, not as a Swift package. There is no Package.swift file listed in the top-level repository entries. You clone the repository and open the Xcode project to browse and copy the examples rather than importing it as a dependency.
What iOS version is required for the PhaseAnimator and KeyframeAnimator examples?
The README explicitly states that the Xcode project contains examples of Phase Animator, Keyframe Animator, and Spring Animations for iOS 17 and beyond. Examples that use GlassEffectContainer require visionOS. The README does not specify a minimum deployment target for the full project.
Does the repository include visionOS and watchOS animation examples?
The README lists visionOS and watchOS as target platforms for the repository alongside iOS and macOS. Specific examples mentioned for visionOS include a 3D Y-rotation animation and the Liquid Glass Shape Morphing Animation using GlassEffectContainer. The 3D Rotate String Characters and Flip String Characters in XYZ examples are also listed.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/amosgyamfi-open-swiftui-animations)
Community notes