ParticlesEmitter

fun ParticlesEmitter(modifier: Modifier = Modifier, config: EmitterConfig, onAnimationFinished: () -> Unit)(source)

A Compose layout-based particle emitter whose particles are arbitrary @Composable content.

Each particle hosts the composable supplied by EmitterConfig.particle (text, an image, an icon, a whole component…) and is moved with Modifier.offset along a kinematic trajectory while spinning via graphicsLayer. This is the right choice when particles must be real UI; for large counts of lightweight shapes, prefer the Canvas-based CanvasParticleEmitter.

The emitter performs a single finite run of EmitterConfig.particlesCount particles — emitted all at once or staggered over EmitterConfig.emitDurationMillis — and removes each particle when its lifespan ends. To replay, supply a new config instance. See MultiEmitter to chain several runs.

Parameters

modifier

the Modifier applied to the emitter container.

config

the EmitterConfig describing count, timing, physics, and the particle composable.

onAnimationFinished

invoked once, after the last particle of the run has completed its lifespan.