Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@theankur/react-animated-numbers
Advanced tools
Library showing animation of number changes in react.js
Library showing animation of number changes in react.js
name | type | default | description |
---|---|---|---|
animateToNumber | number | none | Number to be animated |
animationType | "calm" or "random"` | "random" | Decide whether to increase sequentially, starting with the smallest number |
fontStyle | React.CSSProperties? | none | Style of number text |
includeComma | boolean? | false | Whether the number contains commas |
delay | number(ms)? | undefined | Milliseconds to decide how late to start animation |
includeComma | boolean? | false | Whether the number contains commas |
onStart | (): void? | undefined | Function executed when animation is started |
onFinish | (): void? | undefined | Function executed when animation is finished |
config | SpringConfig? | config.default | This module is using react-spring and you can refer to this config option |
import React from 'react';
import AnimatedNumber from "react-animated-numbers"
function App() {
const [number, setNumber] = React.useState(0)
const [diff, setDiff] = React.useState(0)
const increaseNumber = () => {
setNumber(number + diff)
}
const decreaseNumber = () => {
setNumber(number - diff)
}
const onChangeValue = (e) => {
const number = Number(e.target.value)
setDiff(number)
}
return (
<div className="App">
<div
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
height: "100vh",
flexDirection: "column",
}}
>
<label htmlFor="value">Number Difference</label>
<input
id="value"
title="value"
placeholder="Difference"
type="number"
style={{ marginBottom: 30 }}
onChange={onChangeValue}
/>
<AnimatedNumber
fontStyle={{ fontFamily: "Nunito", fontSize: 40 }}
animateToNumber={number}
includeComma
config={{ tension: 89, friction: 40 }}
onStart={() => console.log("onStart")}
onFinish={() => console.log("onFinish")}
animationType={"calm"}
/>
<div
style={{
height: 60,
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
marginTop: 40,
}}
>
<button onClick={increaseNumber}>increase Number</button>
<button onClick={decreaseNumber}>decrease Number</button>
</div>
</div>
</div>
)
}
FAQs
Library showing animation of number changes in react.js
The npm package @theankur/react-animated-numbers receives a total of 0 weekly downloads. As such, @theankur/react-animated-numbers popularity was classified as not popular.
We found that @theankur/react-animated-numbers demonstrated a not healthy version release cadence and project activity because the last version was released 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.