0.6.3 • Published 8 months ago

react-native-animated-numbers v0.6.3

Weekly downloads
118
License
MIT
Repository
github
Last release
8 months ago

react-native-animated-numbers

PRs Welcome Platform License

Library showing animation of number changes in react-native

If you want web version in react.js download react-animated-numbers

install

yarn add react-native-animated-numbers

props

typedefaultdescription
animateToNumbernumbernoneNumber to be animated
fontStyleTextStyle?noneStyle of number text
animationDurationnumber?1400(ms)The speed at which the animation works
includeCommaboolean?falseWhether the number contains commas
easingEasing?Easing.elastic(1.2)React Native Easing API in Animated
containerStyleViewStyle?noneStyle of container view
fontVariantstring[]'tabular-nums'Font variants for a font
localeIntl.LocalesArgument'en-US'the locale to be used to split the number when includeComma is true

example

import React from 'react';
import { SafeAreaView, Button } from 'react-native';
import AnimatedNumbers from 'react-native-animated-numbers';

const App = () => {
  const [animateToNumber, setAnimateToNumber] = React.useState(7979);

  const increase = () => {
    setAnimateToNumber(animateToNumber + 1999);
  };

  return (
    <SafeAreaView
      style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
    >
      <AnimatedNumbers
        includeComma
        animateToNumber={animateToNumber}
        fontStyle={{ fontSize: 50, fontWeight: 'bold' }}
      />
      <Button title="increase" onPress={increase} />
    </SafeAreaView>
  );
};
export default App;

screenshot

0.6.3

8 months ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.3.0

4 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago