Skip to content

Commit

Permalink
feat: updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaHadjar committed Oct 16, 2024
1 parent 06b0ea3 commit 47f36ab
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,51 @@ The fastest confetti animation library in react native
## Installation

```sh
npm install react-native-fast-confetti
yarn add react-native-fast-confetti
```

## Usage


```js
import { multiply } from 'react-native-fast-confetti';
```tsx
import { Confetti } from 'react-native-fast-confetti';

// ...

const result = await multiply(3, 7);
return (
<View>
{...Your other components}
<Confetti />
{...Your other components}
</View>
)
```

## Props

| Name | Required | Default Value | Description |
|--------------------|----------|-----------------|--------------------------------------------------------------------|
| `count` | No | 200 | Number of confetti pieces to render. |
| `flakeSize` | No | N/A | The size of each confetti flake (object with `width` and `height`).|
| `width` | No | SCREEN_WIDTH | The width of the confetti's container. |
| `height` | No | SCREEN_HEIGHT | The height of the confetti's container. |
| `duration` | No | 8000 ms | The duration of the confetti animation in milliseconds. |
| `autoplay` | No | true | Whether the animation should play on mount. |
| `colors` | No | N/A | The array of confetti flakes colors. |
| `autoStartDelay` | No | 0 | Delay before the confetti animation starts automatically (in ms). |
| `fadeOutOnEnd` | No | N/A | Should the confetti flakes fade out as they reach the bottom. |
| `onAnimationStart` | No | N/A | Callback function triggered when the falling animation starts. |
| `onAnimationEnd` | No | N/A | Callback function triggered when the falling animation ends. |

## Methods

| Name | Description |
|-----------|------------------------------------------------------|
| `restart` | Start the animation from the beginning. |
| `pause` | Pause the animation. |
| `reset` | Reset the animation and prevent it from playing. |
| `resume` | Resume the animation from where it paused. |


## Contributing

Expand Down

0 comments on commit 47f36ab

Please sign in to comment.