like-button-celebration

Like-button-celebration designed to add animated buttons for liking, unliking, upvoting, and custom interactions to your blogs, articles, and web content. With this library, you can easily integrate interactive buttons that celebrate user clicks, adding delightful animations to your web applications.

NPM JavaScript Style Guide

Install

npm install --save like-button-celebration

Required Dependencies

npm install party-js 

Usage

Heart Like button

heartLike

import React, {useState} from 'react'
import { HeartLike } from 'like-button-celebration'

const App = () => {
    const [liked, SetLiked] = useState(user.liked)
  return (
    <>
        <HeartLike 
        //set the State of the Button. ie. Liked or Not
        Active={liked}  // Default true
        />
    </>
    )
}

export default App

The HeartLike component is designed for heart-shaped like buttons and provides various customization options. Here’s a breakdown of the props it accepts, along with their usage and default values:

example

     <HeartLike
        Active={true}
        IconWidth="32"
        IconHeight="32"
        Image="https://example.com/custom-heart-icon.png"
        Speed=
        Spread={70}
        Count=
        Fill="blue"
      />

Thumbs Up Like

Props same as Above Heart Like Button. likebutton

Example

import React, {useState} from 'react'
import { ThumbLike } from 'like-button-celebration'

const App = () => {
    const [liked, SetLiked] = useState(user.liked)
    return 
    (
    <div>
        <ThumbLike
                Active={true} 
                IconWidth="32" 
                IconHeight="32"
                Image="https://example.com/custom-thumb-icon.png" 
                Speed=
                Spread={70} // Control the spread of confetti particles (optional, default: 50)
                Count=
                Fill="blue" 
            />
    </div>
    )
}

export default App

Custom Button with Celebration Animation

Remember, The BeforeClick and AfterClick props are required, and they determine the content to display before and after clicking the button.

Example

import React from 'react';
import { CustomButton } from 'like-button-celebration'

function App() {
  return (
    <div>
      <CustomButton
        // Required
        BeforeClick={<div>Click Me!</div>}
        AfterClick={<div>Clicked!</div>}

        // Optional
        Image="https://example.com/custom-icon.png"
        Speed=
        Spread={70}
        Count=
        
      />
    </div>
  );
}

export default App;


License

MIT © mayurjadhav2002

Feedback

If you have any feedback, please reach out to us at mayurshrikantjadhav@gmail.com

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project’s code of conduct.