The Pasilobus Confetti JavaScript API allows developers to manually trigger confetti effects on their Shopify store. Since the app automatically injects the confetti library, you can call confetti functions directly without any additional setup.
This guide provides an overview of the available confetti functions and how to use them in your custom JavaScript code.
β οΈ Important: The Pasilobus Confetti App must be active in your Shopify theme for the API to function. If the app is not enabled, confetti effects will not trigger. Ensure you have activated the app in the Shopify Theme Editor before using the API.
π― How to Trigger Confetti
To manually trigger confetti, simply call the corresponding function. You can integrate this into buttons, form submissions, or any other interactive elements on your store.
β
Basic Example: Trigger Confetti on Button Click
document.getElementById("confettiButton").addEventListener("click", function() {
popConfetti(); // Triggers the standard colorful confetti effect
});
π Available Confetti Functions
Below is a list of confetti effects you can trigger using the API:
Function Name | Description | Best Use Case |
| Classic colorful confetti burst. | General celebrations, promotions. |
| Randomized confetti spread and angle. | Unique, less uniform effect. |
| Firework-style confetti explosions. | Product launches, big announcements. |
| Gold glitter confetti with elegant particles. | Luxury sales, VIP promotions. |
| Gold glitter confetti fireworks. | Holiday specials, high-end events. |
| Gold-themed pride confetti. | Special awareness campaigns. |
| Falling heart confetti. | Valentineβs Day, romantic promotions. |
| Shooting heart confetti burst. | Engagements, gifts, emotional interactions. |
| Colorful heart pride confetti. | Pride campaigns, inclusivity messaging. |
| Star-shaped confetti explosion. | Achievement celebrations, gamification. |
| School/team-themed confetti. | Back-to-school sales, university stores. |
| Snowfall confetti effect. | Winter sales, holiday campaigns. |
π§ Using Confetti with Custom Triggers
Trigger Confetti on Page Load
window.onload = function() {
popConfetti(); // Fires when the page loads
};
Trigger Confetti on Add-to-Cart Button Click
document.querySelector(".add-to-cart-button").addEventListener("click", function() {
popFireworks();
});
Trigger Confetti on Form Submission
document.getElementById("signupForm").addEventListener("submit", function(event) {
event.preventDefault(); // Prevent default form submission for testing
goldFireworks(); // Show gold confetti when form is submitted
});
π‘ Best Practices
β
Use confetti selectively β Too much can overwhelm the user experience.
β
Match the confetti style to the event β Use hearts for romantic moments, gold for luxury sales, fireworks for big announcements.
β
Test across devices β Ensure confetti effects work smoothly on mobile and desktop.
π Get Creative!
With the Pasilobus Confetti JavaScript API, you can create dynamic, engaging experiences that delight customers and enhance interactions.
β
For more customization options, reach out to our support team! ππ