1.0.0 • Published 2 years ago

react-native-rolling-bar v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

react-native-rolling-bar

Rolling bar UI component for React Native.

Demo

Install

npm install react-native-rolling-bar

Props

Nametypedefault valuedescription
customStyleObject-custom styles for container
intervalnumber3000content change interval time in milliseconds
animationDurationnumber600fade transition duration in milliseconds
delayBetweennumber100delay in milliseconds between fade-out and fade-in of next content (too short delay would cause incorrect transition)
defaultStylebooleanfalseIf false, removes default style. Set true If you want to use default style.
forceRollbooleanfalseIf true, force rolling animation even if there is only one content.

Usage

  1. As a rolling banner
import RollingBar from 'react-native-rolling-bar';

// ...

  <RollingBar interval={3000} defaultStyle={true}>
    // You can fully customize this RollingBar component with customStyle prop.
    <ChildComponentOne />
    <ChildComponentTwo />
    <ChildComponentTree />
    ...
  </RollingBar>
  1. As a transition content
import RollingContent from 'react-native-rolling-bar';

// ...

  <YourBarComponent>
    // Without default style, you can also put the RollingBar inside your bar component.
    <RollingContent interval={3000} defaultStyle={false} customStyle={yourStyle}>
      <ChildOne />
      <ChildTwo />
      ...
    </RollingContent>
  </YourBarComponent>

Acknowledge

Project template generated using react-native-builder-bob 👍

License

MIT