Skip to content

Customizable confetti view for iOS, built with Swift and UIKit. This view components allows you to easily integrate a confetti effect in your application to celebrate your user's achievements or highlight special moments in your app's user experience.

License

Notifications You must be signed in to change notification settings

Kirchberg/Confetti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Confetti

Confetti Thumbnail

Confetti is a comprehensive and customizable confetti view for iOS, built with Swift and UIKit. The set of views allows developers to easily integrate a dynamic confetti effect into their applications, enhancing interactivity and adding a festive mood to the user experience.

Features

  • Configurable Confetti Direction: The ConfettiView can emit confetti in different directions including left, right, top, and bottom.
  • Customizable Emitters: Specify a list of emitter objects to control the appearance and behavior of the confetti particles.
  • Animation Support: A default animation is available that applies gravity and birthrate animations to the confetti particles.
  • Configuration API: Fine-tune particle count, spread, gravity, velocity, drift, scale, spin, lifetime, and more.
  • Preset Configurations: Built-in presets for light, heavy, burst, gentle, fast, and slow effects.
  • Reduced Motion Support: Optionally respect Reduce Motion to avoid emitting confetti.

Usage

let confetti = ConfettiView(
    emitters: [
        .shape(.rectangle, color: .systemYellow),
        .shape(.circle, color: .systemPink),
        .shape(.circle, color: .systemBlue)
    ],
    direction: .top,
    animation: .default,
    configuration: .light
)

view.addSubview(confetti)
confetti.frame = view.bounds
confetti.emit()

Presets

Use the built-in presets to get a polished effect quickly:

  • ConfettiConfiguration.light
  • ConfettiConfiguration.heavy
  • ConfettiConfiguration.burst
  • ConfettiConfiguration.gentle
  • ConfettiConfiguration.fast
  • ConfettiConfiguration.slow

Quick styles

Use the default emitters with a single line:

  • ConfettiView.top
  • ConfettiView.left
  • ConfettiView.right
  • ConfettiView.bottom

Notes

While the views in Confetti are easy-to-use, they also offer a high degree of flexibility, catering to most confetti-related use cases. You might wish to extend or adapt them according to your specific requirements.

Examples

Direction videos

top

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.45.26.mp4

left

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.44.51.mp4

right

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.45.06.mp4

bottom

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.17.49.mp4

Preset videos

light

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.53.41.mp4

heavy

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.53.00.mp4

burst

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.52.26.mp4

gentle

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.51.45.mp4

fast

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.51.07.mp4

slow

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-25.at.16.50.29.mp4

Star History

Star History Chart

License

Licensed under the MIT license. See the LICENSE file for more info.

About

Customizable confetti view for iOS, built with Swift and UIKit. This view components allows you to easily integrate a confetti effect in your application to celebrate your user's achievements or highlight special moments in your app's user experience.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages