6.0.1 • Published 2 years ago
react-native-ticker v6.0.1
React Native Ticker
Create rotating animations of any number, or character.
Changes from v2 to v3
- Rebuilt with 
react-native-reanimated. - Rebuilt with TypeScript.
 - The 
rotateTimeis now calledduration. - Now it measures all widths and heights of items and adjusts accordingly!
 - Supply a 
childrenelement with the value, we no longer supporttextprop. 
Install
yarn add react-native-ticker
npm install react-native-tickerInstall react-native-reanimated.
yarn add react-native-reanimated
npm install react-native-reanimatedAs of V3 we only support the children prop now.
import Ticker from "react-native-ticker";
<Ticker textStyle={styles.text} duration={250}>
  12345.44
</Ticker>;Supply a textStyle, and duration is optional and defaults to 250ms.
If you need more than just numbers you can build and supply your own rotations.
import React, { useState, useEffect } from "react";
import { View, StyleSheet } from "react-native";
import Ticker, { Tick } from "./ticker2";
function getRandom(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
const currencies = ["$", "¥", "€"];
const App = () => {
  const [state, setState] = useState({
      currency: currencies[getRandom(0, 2)],
      value: getRandom(0, 100000)
    });
  useEffect(() => {
    setInterval(() => {
      setState({
        currency: currencies[getRandom(0, 2)],
        value: getRandom(0, 100000)
      });
    }, 500);
  }, []);
  return (
    <View style={styles.container}>
      <Ticker textStyle={styles.text}>
        <Tick rotateItems={currencies}>{state.currency}</Tick>
        {state.value.toLocaleString()}
      </Ticker>
    </View>
  );
};
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
    backgroundColor: "#333"
  },
  text: {
    fontSize: 40,
    color: "#FFF"
  }
});
export default App;You must render a Ticker and subsequently at least one Tick. If it is text then it will simply be rendered.

6.0.1
2 years ago
6.0.0
2 years ago
5.1.0
3 years ago
5.0.1
4 years ago
5.0.0
4 years ago
4.0.0
5 years ago
3.2.0
6 years ago
3.1.1
6 years ago
3.1.0
6 years ago
3.0.0
6 years ago
2.3.0
6 years ago
2.2.1
7 years ago
2.2.0
7 years ago
2.1.1
7 years ago
2.1.0
7 years ago
2.0.3
8 years ago
2.0.2
8 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.5.0
8 years ago
1.4.0
8 years ago
1.3.0
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago
0.0.0
8 years ago