1.0.1 • Published 3 years ago

animated-likes-counter v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

Animated likes counter

Overview

Demo

Live demo page

https://user-images.githubusercontent.com/26141401/176402355-03d786a2-7a4c-4e24-a5cc-c792a9d431f9.mov

Supports

React v17.0.2

Installation

npm i animated-likes-counter

Usage

React

<LikeButtonAnimated />

Style

.block {
  --lba-c-icon-idle: var(--your-color-1);
  --lba-c-icon-hover: var(--your-color-2);
  --lba-c-accent: var(--your-color-3);
  --lba-c-bg: var(--your-color-4);
}

API

PropsValueDescription
disabledButtonbooleanMakes the button inactive
handleLikefunctionThe like event handler is triggered at the end of the flight animation
projectileString / JSXThe jumping element
likesString / JSXCounter
styleobject {countTextActiveColor: String}Props for customize some element styles some
classesobject {root: String, icon: String, countText: String}Props for customize some element classNames some

Example

function App() {
  const [count, setCount] = useState(0);

  return (
    <div className="App">
      <LikeButtonAnimated
        disabledButton={false}
        handleLike={() => setCount((a) => a + 1)}
        likes={count}
        projectile='+1'
        classes={{icon: 'my-class'}}
      />
    </div>
  );
}

Author

Maksim "Amedomary" Grishin, Irlix IT Company

1.0.1

3 years ago

1.0.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago