New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-fast-confetti

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-fast-confetti

The fastest confetti animation library in react native

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
24K
19.53%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-fast-confetti 🎊

🏎️ The fastest confetti animation library in react native written using Skia Atlas API

https://github.com/user-attachments/assets/968a376f-f20c-4a94-886b-65b1625891ae

https://github.com/user-attachments/assets/97184ffd-4146-4806-8262-8f97373e612c

Sreenshots

PI Confetti Confetti

Installation

[!IMPORTANT] This library depends on react-native-reanimated and @shopify/react-native-skia. Make sure to install those first.

yarn add react-native-fast-confetti

Usage

<Confetti />

This animation creates a basic confetti effect where pieces fall from the top in a straight line.

https://github.com/user-attachments/assets/d89ef248-6b27-435e-a322-fb62a3550343

You can also use the cannonPositions option to simulate confetti being launched from cannons before falling. in the screen recording, there's only one cannon. You can also pass multiple cannon positions to shoot confetti from multiple cannons

https://github.com/user-attachments/assets/f59b930d-7c22-4901-9c3e-995cc66b6ae9

import { Confetti, ConfettiMethods } from 'react-native-fast-confetti';

const confettiRef = useRef<ConfettiMethods>(null);
// ...

return (
    <View>
    {...Your other components}
    <Confetti ref={confettiRef} />
    {...Your other components}
    </View>
)

<PIConfetti />

This confetti type creates an effect where flakes burst outward from the center, and then drift down gracefully.

https://github.com/user-attachments/assets/30008c3b-0f1a-4dff-afdb-2ded80809291

import { PIConfetti, PIConfettiMethods } from 'react-native-fast-confetti';

const confettiRef = useRef<PIConfettiMethods>(null);

// Call confettiRef.restart() to render the confetti

return (
    <View>
    {...Your other components}
    <PIConfetti ref={confettiRef} />
    {...Your other components}
    </View>
)

<ContinuousConfetti />

This confetti type creates a continuous confetti effect where flakes continuously fall from the top without stopping.

https://github.com/user-attachments/assets/d2b029c6-ffb8-46cb-9050-e71f95c4b4d7

import { ContinuousConfetti } from 'react-native-fast-confetti';

// ...

return (
    <View>
    {...Your other components}
    <ContinuousConfetti />
    {...Your other components}
    </View>
)

Custom texture

You can pass a custom svg or image to use as the confetti flake

Money StackSnow Simulation
import { Confetti } from 'react-native-fast-confetti';
import { useImage, useSVG } from '@shopify/react-native-skia';

const snowFlakeSVG = useSVG(require('../assets/snow-flake.svg'));
const moneyStackImage = useImage(require('../assets/money-stack.png'));

return (
    <View>
    <Confetti
      type="image"
      flakeImage={moneyStackImage}
    />
    <Confetti
      type="svg"
      flakeSvg={snowFlakeSVG}
    />
    </View>
)

<Confetti /> Props

NameRequiredDefault ValueDescription
countNo200Number of confetti pieces to render.
flakeSizeNo{ width: 8, height: 16 }The size of each confetti flake (object with width and height).
widthNoSCREEN_WIDTHThe width of the confetti's container.
heightNoSCREEN_HEIGHTThe height of the confetti's container.
fallDurationNo8000 msThe duration of confetti falling down (milliseconds).
blastDurationNo300 msThe duration of confetti blast (milliseconds). Use with cannonsPositions
cannonsPositionsNoN/AAn array of positions from which confetti flakes should blast.
autoplayNotrueWhether the animation should play on mount.
isInfiniteNofollows autoplayWether the animation should play again after it ends.
colorsNoN/AThe array of confetti flakes colors.
autoStartDelayNo0Delay before the confetti animation starts automatically (in ms).
verticalSpacingNo30The approximate space between confetti flakes vertically. Lower value results in denser confetti.
fadeOutOnEndNoN/AShould the confetti flakes fade out as they reach the bottom.
onAnimationStartNoN/ACallback function triggered when the falling animation starts.
onAnimationEndNoN/ACallback function triggered when the falling animation ends.
sizeVariationNo0A value of 0.1 means flakes can vary up to 10% smaller than the base (flakeSize), with more flakes clustering towards the original size and fewer towards the minimum size. Recommended value is between 0 and 0.5
rotationNo{ x: { min: 2π, max: 20π }, z: { min: 2π, max: 20π } }The rotation configuration for confetti flakes. Object with optional x and z properties, each containing optional min and max values.
randomSpeedNo{ min: 0.9, max: 1.3 }The random speed multiplier for confetti flakes.
randomOffsetNo{ x: { min: -50, max: 50 }, y: { min: 0, max: 150 } }The random offset for confetti flakes.
easingNoEasing.inOut(Easing.quad)The easing function for the animation.
typeNo'default'The texture type for confetti flakes. Can be 'default', 'image', or 'svg'.
flakeImageNoN/AThe image to use as confetti flake (required when type is 'image').
flakeSvgNoN/AThe SVG to use as confetti flake (required when type is 'svg').
radiusRangeNo[0, 0]The range of the radius of the confetti flakes. A tuple of [min, max] values from which a random radius will be selected for each flake (only for 'default' type).
containerStyleNoN/AThe style of the confetti container. If you use a padding on the container, you need to set the height/width of the container to the same as the parent container.

<PIConfetti /> Props

NameRequiredDefault ValueDescription
countNo200Number of confetti pieces to render.
flakeSizeNo{ width: 8, height: 16 }The size of each confetti flake (object with width and height).
widthNoSCREEN_WIDTHThe width of the confetti's container.
heightNoSCREEN_HEIGHTThe height of the confetti's container.
blastDurationNo300 msThe duration of confetti blast (milliseconds).
fallDurationNo8000 msThe duration of the confetti animation in milliseconds.
blastPositionNo{ x: containerWidth / 2, y: 150 }The position from which confetti flakes should blast.
blastRadiusNo180The radius of the blast.
colorsNoN/AThe array of confetti flakes colors.
fadeOutOnEndNoN/AShould the confetti flakes fade out as they reach the bottom.
onAnimationStartNoN/ACallback function triggered when the falling animation starts.
onAnimationEndNoN/ACallback function triggered when the falling animation ends.
sizeVariationNo0A value of 0.1 means flakes can vary up to 10% smaller than the base (flakeSize), with more flakes clustering towards the original size and fewer towards the minimum size. Recommended value is between 0 and 0.5
rotationNo{ x: { min: π, max: 3π }, z: { min: π, max: 3π } }The rotation configuration for confetti flakes. Object with optional x and z properties, each containing optional min and max values.
randomSpeedNo{ min: 0.9, max: 1.3 }The random speed multiplier for confetti flakes.
randomOffsetNo{ x: { min: -50, max: 50 }, y: { min: 0, max: 150 } }The random offset for confetti flakes.
typeNo'default'The texture type for confetti flakes. Can be 'default', 'image', or 'svg'.
flakeImageNoN/AThe image to use as confetti flake (required when type is 'image').
flakeSvgNoN/AThe SVG to use as confetti flake (required when type is 'svg').
radiusRangeNo[0, 0]The range of the radius of the confetti flakes. A tuple of [min, max] values from which a random radius will be selected for each flake (only for 'default' type).
containerStyleNoN/AThe style of the confetti container. If you use a padding on the container, you need to set the height/width of the container to the same as the parent container.

<ContinuousConfetti /> Props

NameRequiredDefault ValueDescription
countNo200Number of confetti pieces to render.
flakeSizeNo{ width: 8, height: 16 }The size of each confetti flake (object with width and height).
widthNoSCREEN_WIDTHThe width of the confetti's container.
heightNoSCREEN_HEIGHTThe height of the confetti's container.
fallDurationNo8000 msThe duration of confetti falling down (milliseconds).
blastDurationNo300 msThe duration of confetti blast (milliseconds).
cannonsPositionsNoN/AAn array of positions from which confetti flakes should blast.
colorsNoN/AThe array of confetti flakes colors.
autoStartDelayNo0Delay before the confetti animation starts automatically (in ms).
verticalSpacingNo200The approximate space between confetti flakes vertically. It's recommended to set some large value e.g. 200
fadeOutOnEndNoN/AShould the confetti flakes fade out as they reach the bottom.
onAnimationStartNoN/ACallback function triggered when the falling animation starts.
onAnimationEndNoN/ACallback function triggered when the falling animation ends.
sizeVariationNo0A value of 0.1 means flakes can vary up to 10% smaller than the base (flakeSize), with more flakes clustering towards the original size and fewer towards the minimum size. Recommended value is between 0 and 0.5
rotationNo{ x: { min: 2π, max: 20π }, z: { min: 2π, max: 20π } }The rotation configuration for confetti flakes. Object with optional x and z properties, each containing optional min and max values.
randomSpeedNo{ min: 1, max: 1.2 }The random speed multiplier for confetti flakes.
randomOffsetNo{ x: { min: -50, max: 50 }, y: { min: 0, max: 150 } }The random offset for confetti flakes.
typeNo'default'The texture type for confetti flakes. Can be 'default', 'image', or 'svg'.
flakeImageNoN/AThe image to use as confetti flake (required when type is 'image').
flakeSvgNoN/AThe SVG to use as confetti flake (required when type is 'svg').
radiusRangeNo[0, 0]The range of the radius of the confetti flakes. A tuple of [min, max] values from which a random radius will be selected for each flake (only for 'default' type).
containerStyleNoN/AThe style of the confetti container. If you use a padding on the container, you need to set the height/width of the container to the same as the parent container.

ConfettiMethods

NameDescriptionArguments
restartStart the animation from the beginning.options?: ConfettiRestartOptions
pausePause the animation.-
resetReset the animation and prevent it from playing.-
resumeResume the animation from where it paused.-

PIConfettiMethods

NameDescriptionArguments
restartStart the animation from the beginning.options?: PIConfettiRestartOptions
pausePause the animation.-
resetReset the animation and prevent it from playing.-
resumeResume the animation from where it paused.-

ConfettiRestartOptions

NameDescription
cannonsPositionsIf you want to override the default cannonsPositions prop, you can pass an array of positions here. This allows you to dynamically change the cannon positions.

PIConfettiRestartOptions

NameDescription
blastPositionIf you want to override the default blastPosition prop, you can pass a position here. This allows you to dynamically change the blast position.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Made with create-react-native-library

Keywords

react-native

FAQs

Package last updated on 12 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts