Configure custom textures in v2
mainIn v2, textures (images or SVGs) can be applied at two levels:
- Parent-level: Applying
imageorsvgto the main component (e.g.,<Confetti image={image}>) applies that texture to all flakes. - Flake-level: Applying
imageorsvgto a<*.Flake />child overrides the parent texture for that specific flake type. This allows for mixed textures in a single animation.
// Parent-level texture
<Confetti image={image}>
<Confetti.Flake size={50} />
</Confetti>
// Flake-level overrides
<Confetti>
<Confetti.Flake size={50} image={image} />
<Confetti.Flake size={30} svg={svg} />
<Confetti.Flake width={8} height={14} />
</Confetti>