New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-countplus

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-countplus

A flexible and customizable React component for animated number counting.

Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
4
Maintainers
0
Weekly downloads
 
Created
Source

react-countplus

A flexible and customizable React component for animated number counting.

Installation

Install the package using npm:

npm install react-countplus

Usage

Here's a basic example of how to use the CountPlus component:

import React from "react";
import { CountPlus } from "react-countplus";

const App = () => {
  return (
    <div>
      <CountUp
        end={1000}
        duration={5}
        prefix="$"
        suffix=" USD"
        separator=","
        formatFunction={(value) => value.toFixed(2)}
        onStart={() => console.log("Counting started!")}
        onUpdate={(value) => console.log("Current value:", value)}
        onComplete={() => console.log("Counting completed!")}
      />
    </div>
  );
};

export default App;

Props

The CountUp component accepts the following props:

Prop NameTypeDescriptionDefault Value
endnumberThe final number to count up to (required)-
startnumberThe number to start counting from0
durationnumberDuration of the count animation in seconds2
easingFunctionfunctionCustom easing function for the animationeaseOutQuad
formatFunctionfunctionCustom function to format the displayed numbertoString
prefixstringString to display before the number""
suffixstringString to display after the number""
separatorstringCharacter used as the thousands separator","
onStartfunctionCallback function called when the animation starts-
onUpdatefunctionCallback function called on each update with the current value-
onCompletefunctionCallback function called when the animation completes-

Features

  • Smooth counting animation
  • Customizable duration and easing
  • Prefix and suffix support
  • Thousand separator
  • Custom formatting function
  • Start, update, and complete callbacks

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you'd like to contribute to this project.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

FAQs

Package last updated on 16 Jul 2024

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