Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/animate-react-native/stagger

A cross-platform React Native Stagger component, powered by Reanimated
https://github.com/animate-react-native/stagger

react-native react-native-animation react-native-layout-animation react-native-stagger react-native-stagger-view reanimated2 reanimated3 stagger-animation

Last synced: 3 days ago
JSON representation

A cross-platform React Native Stagger component, powered by Reanimated

Awesome Lists containing this project

README

        


React Native Stagger

AnimateReactNative.com - Premium and Custom React Native animations.

[![NPM Version](https://img.shields.io/npm/v/@animatereactnative/stagger.svg?style=flat&color=black)](https://www.npmjs.org/package/@animatereactnative/stagger) [![runs with expo](https://img.shields.io/badge/Runs%20with%20Expo-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.io/) [![npm](https://img.shields.io/npm/l/@animatereactnative/stagger?style=flat-square)](https://www.npmjs.com/package/@animatereactnative/stagger) [![npm](https://img.shields.io/badge/types-included-blue?style=flat-square)](https://www.npmjs.com/package/@animatereactnative/stagger) Follow Miron Catalin

React Native Stagger component, a cross-platform stagger orchestrator component, powered by Reanimated:

- 🔋 Powered by **Reanimated 3** Layout Animations
- 📱 Works with **Expo**
- ✅ Cross-platform (iOS, Android, Web - requires `reanimated@>=3.4.0`)
- ⚡️ 60-120fps
- 🪝 Works with any React Native element/component
- ⌨️ Written in TypeScript

## Installation

```sh
npm install @animatereactnative/stagger
```

> Also, you need to install [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated), and follow their installation instructions.

## Usage

```js
import { Stagger } from '@animatereactnative/stagger';

// ...

export function Example() {
return (
ZoomInEasyDown.springify()}
exiting={() => FadeOutDown.springify()}
style={{
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
gap: 12,
}}
>
1. Custom duration
2. Custom stagger
3. Custom animation
4. Custom enter/exit direction
AnimateReactNative.com
Powered by Reanimated 3
Works with Expo ❤️

);
}
```

## Props

| name | description | required | type | default |
| ---------------------- | ------------------------------------------------------------------------------------------------------------ | -------- | ------------------------------- | ------------- |
| `children` | Any component that you'd like to apply infinite scrolling / marquee effect | YES | `React.ReactNode` | 1 |
| `enabled` | Enable stagger animation | NO | `boolean` | true |
| `stagger` | Stagger duration between elements | NO | `number` | 50 |
| `duration` | Enter/Exit animation duration | NO | `number` | 400 |
| `enterDirection` | The direction of the animation. `1 -> top to bottom`, `-1 -> bottom to top` | NO | `number` | 0 |
| `exitDirection` | The direction of the animation. `1 -> top to bottom`, `-1 -> bottom to top` | NO | `number` | 0 |
| `initialEnteringDelay` | Initial enter animation delay | NO | number | 1 |
| `initialExistingDelay` | Initial exit animation delay | NO | number | -1 |
| `onEnterFinished` | callback to announce when the last item animation has finished (direction dependent) | NO | () => void | undefined |
| `onExitFinished` | callback to announce when the last item animation has finished (direction dependent) | NO | () => void | undefined |
| `enter` | [Reanimated Enter animation](https://www.reanimated3.com/docs/layout-animations/entering-exiting-animations) | NO | `() => ComplexAnimationBuilder` | `FadeInDown` |
| `exiting` | [Reanimated Exit animation](https://www.reanimated3.com/docs/layout-animations/entering-exiting-animations) | NO | `() => ComplexAnimationBuilder` | `FadeOutDown` |
| `style` | View style to be applied to Marquee container. | NO | `StyleProp` | |

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

[MIT](./LICENSE)

---





AnimateReactNative.com - Premium and Custom React Native animations.