New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

react-countup

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-countup - npm Package Compare versions

Comparing version 6.0.0-2 to 6.0.0

{
"name": "react-countup",
"version": "6.0.0-2",
"version": "6.0.0",
"description": "A React component wrapper around CountUp.js",

@@ -5,0 +5,0 @@ "author": "Glenn Reyes <glenn@glennreyes.com> (https://twitter.com/glnnrys)",

@@ -61,2 +61,5 @@ # [React CountUp](https://tr8tk.csb.app/)

- [Protips](#protips)
- [Trigger of transition](#trigger-of-transition)
- [Run if in focus](#run-if-in-focus)
- [Set accessibility properties for occupation period](#set-accessibility-properties-for-occupation-period)
- [License](#license)

@@ -366,4 +369,43 @@

### Set accessibility properties for occupation period
You can use callback properties to control accessibility:
```js
import React from "react";
import CountUp, { useCountUp } from "react-countup";
export default function App() {
useCountUp({ ref: "counter", end: 10, duration: 2 });
const [loading, setLoading] = React.useState(false);
const onStart = () => {
setLoading(true);
};
const onEnd = () => {
setLoading(false);
};
const containerProps = {
"aria-busy": loading
};
return (
<>
<CountUp
end={123457}
duration="3"
onStart={onStart}
onEnd={onEnd}
containerProps={containerProps}
/>
<div id="counter" aria-busy={loading} />
</>
);
}
```
## License
MIT