react-native-slot-text
v2.0.0
Published
Slot machine style animted text for React Native
Downloads
367
Maintainers
Readme
react-native-slot-text
To install dependencies:
bun install react-native-slot-text
This project was created using bun init
in bun v1.1.21. Bun is a fast all-in-one JavaScript runtime.
https://github.com/user-attachments/assets/e2e22b9a-17a8-4b17-b069-0c6b4854c915
Usage
<SlotText
fontStyle={styles.animatedNumbers}
value={`${value}`}
prefix='$'
animationDuration={200}
includeComma={true}
/>
Props
| Prop | Type | Default | Description |
|---------------------|-----------------------|----------|--------------------------------------------------------------------------------------------------|
| value
| '${number}' | N/A
| The value to animate to. Can be a number or a string of numbers. |
| fontStyle
| Object
| N/A
| The style of the text, passed as a TextStyle
object. |
| animationDuration
| number
| 200
| The duration of the animation in milliseconds. Defaults to 200ms. |
| prefix
| string
| ""
| A prefix to the number, such as a currency symbol. |
| includeComma
| boolean
| false
| Whether to include commas as thousand separators. |