Skip to contents

This gallery demonstrates the visual engines available in sparkler. These effects render using HTML5 Canvas.

1. Weather Effects (Atmosphere)

Use sparkler::weather() to create ambient backgrounds. By default in RMarkdown, these render in a contained box.

Snow

sparkler::weather(type = "snow", density = 2, height = "300px")

Rain

sparkler::weather(type = "rain", density = 1, speed = 0.8, height = "300px")

Meteors

sparkler::weather(type = "meteor", density = 1, height = "300px")

2. Celebration Effects

These effects are typically triggered by events (like a button click in Shiny), but here we trigger them on page load.

Confetti

# This creates a burst of confetti inside this box
sparkler::confetti(particle_count = 100, spread = 170)

Fireworks

# Fireworks run for a specific duration
sparkler::fireworks(duration = 10, speed = 1)