Move your mouse to create confetti!
)
}
```
--------------------------------
### React Confetti Component Properties
Source: https://github.com/alampros/react-confetti/blob/develop/README.md
Configuration options for the react-confetti component.
```APIDOC
## React Confetti Component Properties
### Description
This section details the configurable properties for the react-confetti component, allowing for customization of its appearance and behavior.
### Properties
#### `initialVelocityY`
- **Type**: `Number` | `{ min: Number, max: Number }`
- **Default**: `10`
- **Description**: Range of values between which confetti is emitted vertically. Positive numbers indicate downward emission, and negative numbers indicate upward emission. Providing a single number `y` is equivalent to providing a range `{ min: -y, max: 0 }`.
#### `colors`
- **Type**: `String[]`
- **Default**: `['#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B', '#FFC107', '#FF9800', '#FF5722', '#795548']`
- **Description**: An array of all available colors for the confetti pieces.
#### `opacity`
- **Type**: `Number`
- **Default**: `1.0`
- **Description**: The opacity of the confetti pieces.
#### `recycle`
- **Type**: `Bool`
- **Default**: `true`
- **Description**: Determines whether to continue spawning confetti after the initial `numberOfPieces` have been shown.
#### `run`
- **Type**: `Bool`
- **Default**: `true`
- **Description**: Controls whether the animation loop runs. Set to `false` to pause the animation.
#### `frameRate`
- **Type**: `Number` | `undefined`
- **Default**: `undefined`
- **Description**: The capped frame rate of the animation. If `undefined`, the browser's default frame rate is used.
#### `tweenDuration`
- **Type**: `Number`
- **Default**: `5000`
- **Description**: Specifies how fast the confetti is added to the animation, in milliseconds.
#### `tweenFunction`
- **Type**: `(currentTime: number, currentValue: number, targetValue: number, duration: number, s?: number) => number`
- **Default**: `easeInOutQuad`
- **Description**: A function that defines the easing curve for the confetti animation. Refer to [tween-functions](https://github.com/chenglou/tween-functions) for available options.
#### `drawShape`
- **Type**: `(context: CanvasRenderingContext2D) => void`
- **Default**: `undefined`
- **Description**: A custom function to draw the shape of the confetti pieces. It receives the 2D canvas rendering context as an argument.
#### `onConfettiComplete`
- **Type**: `(confetti: Confetti) => void`
- **Default**: `undefined`
- **Description**: A callback function that is executed when all confetti pieces have fallen off the canvas.
```
--------------------------------
### Create Snow Effect with Custom Shapes
Source: https://context7.com/alampros/react-confetti/llms.txt
Use the drawShape prop to create a continuous snow effect with custom snowflake shapes and physics. Requires react-use for window size.
```jsx
import React from 'react'
import { useWindowSize } from 'react-use'
import Confetti from 'react-confetti'
function SnowEffect() {
const { width, height } = useWindowSize()
const drawSnowflake = function(ctx) {
const numPoints = this.numPoints || 6
this.numPoints = numPoints
const innerRadius = this.radius * 0.2
const outerRadius = this.radius * 0.8
ctx.beginPath()
ctx.moveTo(0, -outerRadius)
for (let n = 1; n < numPoints * 2; n++) {
const radius = n % 2 === 0 ? outerRadius : innerRadius
const x = radius * Math.sin((n * Math.PI) / numPoints)
const y = -radius * Math.cos((n * Math.PI) / numPoints)
ctx.lineTo(x, y)
}
ctx.fill()
ctx.stroke()
ctx.closePath()
}
return (