Particle Transitions

Particle-powered view transitions with a self-contained Canvas burst engine — poof smoke cloud, pop ripple with particle flurry, and anvil slam with dust impact

Free
Free with a ShipSwift account.

Copies a short instruction with your private download link. Paste it into your agent: it downloads the whole skill (the source code, the setup steps and the mistakes we already made for you) and builds the screen.

Works with

+70

What it does

Three view transitions where a Canvas-rendered particle burst sells the effect: swPoof makes the view vanish (or appear) in a cartoon puff of smoke, swPop pops it in with a ripple ring and a flurry of colored dots, and swAnvil slams it down from above with dust kicking out on impact. The burst engine is self-contained in this file — particles run on their own TimelineView clock with analytic physics (position, gravity, growth, fade evaluated per frame), independent of the transition's interpolation. Built on SwiftUI's Transition protocol.

What you get

  • ✓340 lines of source code, ready to paste
  • ✓Source Code
  • ✓Usage
  • ✓Parameters
  • ✓Integration Checklist
  • ✓Known Gotchas
animationtransitionparticlespoofpopanvilCanvasSwiftUI

Usage

// Pop a badge in with ripple + particles
if showBadge {
    BadgeView()
        .transition(.swPop)
}
withAnimation(.spring(duration: 0.5, bounce: 0.55)) { showBadge.toggle() }

// Poof works best around half a second
.transition(.swPoof)     // with .easeOut(duration: 0.5)

// Anvil needs a hard ease-in drop
.transition(.swAnvil)    // with .easeIn(duration: 0.22)

// Custom particle colors for pop
.transition(.swPop(colors: [.pink, .orange, .yellow]))

// Pair anvil with a heavy haptic on the toggling state
.sensoryFeedback(.impact(weight: .heavy), trigger: showBadge)

Recommended animations:

EffectAnimation
swPoof.easeOut(duration: 0.5)
swPop.spring(duration: 0.5, bounce: 0.55)
swAnvil.easeIn(duration: 0.22)

Parameters

TransitionParameterDefaultDescription
swPopcolorspink/orange/yellow/mint/cyanParticle color cycle
swAnvildropDistance350Fall height in pts
swAnvilimpactDelay0.2Seconds between phase change and dust burst — match your drop animation duration

Integration Checklist

  • Add SWParticleTransition.swift to your project (iOS 18+ / macOS 15+)
  • Attach .transition(.swPoof / .swPop / .swAnvil) to a view inside an if
  • Toggle inside withAnimation(...) using the recommended curve — anvil specifically needs a fast ease-in so touchdown matches the dust burst
  • Optionally add .sensoryFeedback(.impact(weight: .heavy), trigger:) on the toggling state for anvil
  • Leave headroom around the view — bursts draw up to 70pt beyond its bounds

Known Gotchas

  • Don't clip the parent: bursts render in an overlay expanded via .padding(-70). A clipped() / cornerRadius ancestor will shear the smoke/dust off at the view edge.
  • Removal duration bounds the show: once the exit animation completes, SwiftUI tears the view (and its burst overlay) down. Poof and pop also burst on removal, so keep their removal animations ≥ 0.45s or the burst is cut off; anvil bursts on insertion only.
  • swAnvil.impactDelay must match the drop animation duration (default 0.2 pairs with .easeIn(duration: 0.22)) — if you slow the drop, raise the delay or dust flies before touchdown.
  • Particles are deliberately regenerated per burst with random(in:); two bursts never look identical. That randomness lives outside the transition interpolation, so scrubbing/interactive transitions still work.
  • The poof fade compresses visibility into the first 40% of the timeline (SWPoofFadeModifier) so the view is gone while smoke still lingers — if you customize durations, keep that ratio or the card outlives its own smoke.

More in Effects and animation

Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
Metal dot fields
Free
Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Deep-space starfield
Free
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Neon outlines
Free
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
Liquid metaballs
Free
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
3D network graph
Free
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
Orbit ring and wallet
Free
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
A field of bright colored dots that float and shimmer across the whole screen.
Floating color dots
Free
A field of bright colored dots that float and shimmer across the whole screen.
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Glass color panels
Free
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Dot sphere
Free
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Cells and swirl
Free
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.
Noise veins and blobs
Free
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.