0.5.0 • Published 1 year ago

react-native-marquee v0.5.0

Weekly downloads
682
License
MIT
Repository
github
Last release
1 year ago

react-native-marquee

A pure JavaScript marquee text component for react native.

Installation

npm install --save react-native-marquee
or
yarn add react-native-marquee

Usage

import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import MarqueeText from 'react-native-marquee';

export default class MarqueeTextSample extends Component {
  render() {
    return (
      <View style={styles.container}>
        <MarqueeText
          style={{ fontSize: 24 }}
          speed={1}
          marqueeOnStart={true}
          loop={true}
          delay={1000}
        >
          Lorem Ipsum is simply dummy text of the printing and typesetting industry and typesetting industry.
        </MarqueeText>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

Properties

MarqueeText component basically inherits TextProps and the followings are additional ones:

PropTypeOptionalDefaultDescription
marqueeOnStartbooleantruetrueA flag whether to start marquee animation right after render
speednumbertrue1Speed calculated as pixels/second
loopbooleantruetrueA flag whether to loop marquee animation or not
delaynumbertrue0Duration to delay the animation after render, in milliseconds
onMarqueeCompletefunctiontruevoidA callback for when the marquee finishes animation and stops
consecutivebooleantruefalseA flag to enable consecutive mode that imitates the default behavior of HTML marquee element. Does not take effect if loop is false

Methods

These methods are optional, you can use the isOpen property instead

PropParamsDescription
start-Start animation
stop-Stop animation

Contribution

Do you have any idea or want to change something? Just open an issue. Contributions are always welcome.

Lisence

MIT Lisence

0.5.0

1 year ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.2

6 years ago

0.3.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago