API Docs
Confetti

Confetti

Display confetti animation in your notebook.

import mercury as mr
# display confetti
mr.Confetti()
Mercury App with Confetti widget

Example app

Example app that ask user to guess some number. If

import mercury as mr
app = mr.App(title="Confetti App", description="App with Confetti widget", show_code=True)
my_number = mr.Slider(label="Guess some number", value=2, min=0, max=10)
print(f"You selected {my_number.value}")
if my_number.value > 5:
    mr.Confetti()
    print("You win!")
else:
    print("Try larger number")

You can access application on Mercury Cloud at address docs.runmercury.com/app/confetti (opens in a new tab).

App Confetti from Jupyter Notebook

The notebook's code:

App Confetti Python code in Jupyter Notebook