Confetti Burst

Canvas-rendered celebration confetti burst overlay with 4 particle shapes, customisable colors, gravity, and spread

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

Celebration confetti burst overlay. When isActive flips to true, a shower of colourful shapes (rectangles, circles, triangles, strips) erupts from the bottom of the frame, arcs under gravity, spins with a 3D wobble, and fades out. Rendered with a single SwiftUI Canvas per frame so hundreds of particles stay at 60fps. Available as a wrapper view or a .swConfetti() modifier.

What you get

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

Usage

// Basic — toggle triggers one burst
SWConfetti(isActive: $celebrate) {
    Text("You did it!")
}

// As an overlay on any view
myView.swConfetti(isActive: $showConfetti)

// Custom colors and intensity
SWConfetti(
    isActive: $celebrate,
    particleCount: 120,
    colors: [.red, .orange, .yellow, .green, .blue, .purple],
    spread: .wide,
    duration: 4.0
) {
    myContent
}

// Fire-and-forget (auto-resets isActive after burst finishes)
SWConfetti(isActive: $celebrate, autoReset: true) {
    Button("Celebrate") { celebrate = true }
}

// Gold confetti with narrow cone
myView.swConfetti(
    isActive: $celebrate,
    particleCount: 100,
    colors: [.yellow, .orange, Color(red: 1, green: 0.84, blue: 0)],
    spread: .narrow,
    autoReset: true
)

Parameters

ParameterTypeDefaultDescription
isActiveBinding<Bool>—Set to true to fire one burst
particleCountInt80Number of particles per burst
colors[Color]Rainbow 6Colour palette randomly assigned to particles
shapes[SWConfettiShape]All fourWhich shapes to include
spreadSWConfettiSpread.mediumLaunch cone: .narrow (30°), .medium (60°), .wide (90°)
durationDouble3.0Seconds until particles fully fade
gravityDouble500Downward acceleration in pts/s²
autoResetBoolfalseFlip isActive back to false when burst finishes

Integration Checklist

  • Add SWConfetti.swift to your project
  • Create a @State private var celebrate = false to drive it
  • Wrap your content with SWConfetti(isActive: $celebrate) or use .swConfetti(isActive: $celebrate) modifier
  • Set celebrate = true when the celebration event fires (purchase, achievement, etc.)
  • Use autoReset: true for fire-and-forget behaviour

Known Gotchas

  • The Canvas overlay is non-interactive (allowsHitTesting(false)) so it won't block touches on content below
  • Particles launch from the bottom centre of the view frame — make sure the parent has adequate height
  • TimelineView(.animation) keeps rendering every frame while particles are alive; the view stops updating after duration seconds

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.