Giter Site home page Giter Site logo

animate-react-native / stagger Goto Github PK

View Code? Open in Web Editor NEW
142.0 3.0 6.0 4.34 MB

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

Home Page: https://www.animatereactnative.com

License: MIT License

JavaScript 21.71% TypeScript 78.29%
react-native react-native-animation react-native-stagger-view reanimated2 reanimated3 react-native-layout-animation react-native-stagger stagger-animation

stagger's Introduction

React Native Stagger

AnimateReactNative.com - Premium and Custom React Native animations.

NPM Version runs with expo npm npm 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

npm install @animatereactnative/stagger

Also, you need to install react-native-reanimated, and follow their installation instructions.

Usage

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

// ...

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

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 NO () => ComplexAnimationBuilder FadeInDown
exiting Reanimated Exit animation NO () => ComplexAnimationBuilder FadeOutDown
style View style to be applied to Marquee container. NO StyleProp<ViewStyle>

Contributing

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

License

MIT


AnimateReactNative.com - Premium and Custom React Native animations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.