Confetti Component

This documentation provides information on how to use the confetti function to create a confetti animation on a webpage.

To unlock early access to the component Get Access


To install the Quest react-sdk into your project, follow these steps:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

npm install @questlabs/react-sdk

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.


To use the confetti function, follow these steps:

  1. Import the confetti function if it's in a separate module:

    import { confetti } from '@questlabs/react-sdk'; // Import the confetti module.
    import '@questlabs/react-sdk/dist/style.css'
  2. Call the confetti function with an optional duration (in milliseconds):

    javascriptCopy code// Example: Display confetti for 3 seconds (3000 milliseconds).
  3. The confetti animation will be displayed on the webpage for the specified duration, and then it will automatically disappear.

Example Usage

Here's an example of how to use the confetti function within your web application:

import { confetti } from '@questlabs/react-sdk';  // Import the confetti module.

function celebrateEvent() {
  // Display confetti for 5 seconds (5000 milliseconds).

// Trigger the confetti animation on a celebration event, like a button click.

This documentation provides an overview of the confetti function, usage instructions, and an example of how to trigger the confetti animation in your web application. You can adapt it to your specific needs and provide more details if necessary.


Last updated