Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heyman333/react-native-animated-numbers

🎰 Library showing animation of number changes in react-native
https://github.com/heyman333/react-native-animated-numbers

animated animation numbers react-native

Last synced: 5 days ago
JSON representation

🎰 Library showing animation of number changes in react-native

Awesome Lists containing this project

README

        

# react-native-animated-numbers

[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](https://github.com/heyman333/react-native-animated-numbers/pulls)
[![Platform](https://img.shields.io/badge/platform-react--native-lightgrey.svg)](http://facebook.github.io/react-native/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/heyman333/react-native-animated-numbers/blob/master/LICENSE)


npm version



Library showing animation of number changes in react-native

If you want web version in react.js [download react-animated-numbers](https://github.com/heyman333/react-animated-numbers)

## install

```shell
yarn add react-native-animated-numbers
```

## props

| | type | default | description |
| :---------------: | :--------: | :-----------------: | -------------------------------------- |
| animateToNumber | number | none | Number to be animated |
| fontStyle | TextStyle? | none | Style of number text |
| animationDuration | number? | 1400(ms) | The speed at which the animation works |
| includeComma | boolean? | false | Whether the number contains commas |
| easing | Easing? | Easing.elastic(1.2) | React Native Easing API in Animated |
| containerStyle | ViewStyle? | none | Style of container view |
| fontVariant | string[] | ['tabular-nums'] | Font variants for a font |
| locale | Intl.LocalesArgument | 'en-US' | the locale to be used to split the number when includeComma is true |

## example

```js
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 (




);
};
export default App;
```

## screenshot