Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-slot-counter

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slot-counter

React Slot Counter Component

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5K
decreased by-57.05%
Maintainers
1
Weekly downloads
 
Created
Source

react-slot-counter

React component that uses slot machine animations to display numbers and strings. It is possible to set the duration of the animation and the class name of the character and separator.

Installation

npm install react-slot-counter

Usage

import React from 'react';
import SlotCounter from 'react-slot-counter';

function App() {
  return (
    <div>
      <SlotCounter value={123456} />
      <SlotCounter value="1,234,567" />
      <SlotCounter value="??????" />
      <SlotCounter value={36.5} duration={2} />
      <SlotCounter
        value={123456}
        charClassName="char"
        separatorClassName="sep"
      />
    </div>
  );
}

export default App;

Demo

Check out the demo page for examples of usage and options.

Props

PropTypeDefaultDescription
value (required)number or stringThe value to be displayed. It can be a number or a string with numbers and commas. If the string contains other characters, they will be displayed as question marks.
durationnumber0.6The duration of the animation in seconds.
charClassNamestringThe class name of each character.
separatorClassNamestringThe class name of the separator character (. or ,).

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 11 Mar 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