Socket
Socket
Sign inDemoInstall

react-native-number-animate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-number-animate

Elevate your React Native app's user experience with the power of animated numbers! I'm thrilled to present react-native-number-animate, a lightweight and customizable package designed to seamlessly integrate animated numeric displays into your React Nati


Version published
Maintainers
1
Created
Source

license platforms

React Native Number Animate

🚀 Introducing react-native-number-animate

Elevate your React Native app's user experience with the power of animated numbers! I'm thrilled to present react-native-number-animate, a lightweight and customizable package designed to seamlessly integrate animated numeric displays into your React Native projects.

Features

🔢 Smooth Animations: Bring numbers to life with smooth and eye-catching animations. Whether it's counting up, counting down, or transitioning between values, our package ensures a visually engaging experience for your users.

⚙️ Customization: Tailor the appearance and behavior of animated numbers to suit your app's design language. With customizable fonts, colors, and animation styles, you have the flexibility to create a seamless integration with your app's aesthetics.

🔄 Versatile Usage: Perfect for a variety of use cases, from displaying real-time data updates to creating dynamic counters or countdowns. react-native-number-animate adapts to your needs, providing a versatile solution for numeric animations.

📦 Easy Integration: Effortlessly integrate animated numbers into your React Native application. Our package is designed for simplicity and ease of use, allowing you to focus on enhancing your app's user interface without the hassle of complex implementation.

Demo

Installation

This package is using react-native-reanimated. It should be installed first.

npm install react-native-reanimated react-native-gesture-handler && cd ios && pod install

Then

npm install react-native-number-animate

!! IMPORTANT !!

lineHeight in textStyle prop and textHeight prop must be THE SAME (Default value is the 25 for both)

• for iOS, you can use just fontSize prop in textStyle prop but it makes glitch in Android when you do not use lineHeight.

• DO NOT FORGET to use overflow:"hidden" and flexDirection:"row" when you change style of container

<AnimatedNumber
    number={number}
    textStyle={{
        fontSize: 25,
        color: "#fff",
    l   ineHeight: 25
    }}
    textHeight={25}
    containerStyle={{
        height: 25,
        flexDirection: 'row',
        overflow: "hidden"
    }}
/>

Basic Usage

import AnimatedNumber from "react-native-number-animate";

function App() {
  return <AnimatedNumber number={number} />;
}

Props

PropDescriptionTypeDefault ValueRequired
numbernumber to animateNumber or String0true
enteringAnimationreanimated entering animationEntryOrExitLayoutTypeFadeIn.duration(400)false
exitingAnimationreanimated exiting animationEntryOrExitLayoutTypeFadeOut.duration(400)false
commaLayoutAnimationcomma layout animation (reanimated layout animation)AnimatedProps['layout']LinearTransition.springify()false
textStylenumber text styleTextStyle{fontSize: 25,lineHeight: 25,color: "#fff"}false
containerStylegeneral container styleViewStyle{ flexDirection: 'row',height: 25,overflow: "hidden"}false
disableDefaultAnimationsdisable all animationsBooleanfalsefalse
textContainerStylenumber text container styleViewStyle{justifyContent: 'center',alignItems: 'center'}false
durationnumber animation duration (ms)Number1000false
easingnumber animation easing function (reanimated)EasingFunctionEasing.inOut(Easing.ease)false
textHeightnumber container height for animate (you must read !! IMPORTANT !! section)Number25false

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 10 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc