
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
react-animated-numbers
Advanced tools
Library showing animation of number changes in react.js
name | type | default | description |
---|---|---|---|
animateToNumber | number | none | Number to be animated |
fontStyle | React.CSSProperties? | none | Style of number text |
includeComma | boolean? | false | A value that determines whether to show a comma or not. |
locale | string? | en-US | Formats animated number as per locale. Also it should be used with inculdeComma prop. For list of locales, search for "BCP 47 language tags" |
transitions | (index: number) => Transition$1? | none | framer-motion transitions. The order of numbers shown is passed as a parameter. |
className | string? | none | ClassName for style |
You have to use dynamic imports to ensure that this library is imported on the client side only.
Import the library like this:
import dynamic from "next/dynamic";
const AnimatedNumbers = dynamic(() => import("react-animated-numbers"), {
ssr: false,
});
Credit to @jedwardblack for this
Use the library like this:
"use client";
import AnimatedNumbers from "react-animated-numbers"
import React from "react";
import AnimatedNumbers from "react-animated-numbers";
import "./App.css";
function App() {
const [num, setNum] = React.useState(331231);
return (
<div className="container">
<AnimatedNumbers
includeComma
className={styles.container}
transitions={(index) => ({
type: "spring",
duration: index + 0.3,
})}
animateToNumber={number}
fontStyle={{
fontSize: 40,
color: "red",
}}
/>
<div>
<button onClick={() => setNum((state) => state + 31234)}>+</button>
<button onClick={() => setNum((state) => state - 31234)}>-</button>
</div>
</div>
);
}
export default App;
FAQs
Library showing animation of number changes in react.js
The npm package react-animated-numbers receives a total of 8,097 weekly downloads. As such, react-animated-numbers popularity was classified as popular.
We found that react-animated-numbers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.