1.0.4 • Published 7 months ago

lesca-react-scratch-card v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

NPM React React React React React NPM

Why use it?

a scratch card component use react v18+.

Live Demo

Installation

npm install lesca-react-scratch-card --save

Usage

As a Node module:

import ScratchCard from 'lesca-react-scratch-card';
import Image from './img/cover.jpg';

In the compnenet

const component = () => {
  return (
    <ScratchCard
      cover={Image}
      percent={50}
      width={100}
      height={100}
      onComplete={() => {
        // ...script
      }}
    >
      your card content
    </ScratchCard>
  );
};

Development

Props

Propsdescriptiondefault
cover:stringscratch card cover image
width:numbercard width320
height:numbercard height240
percent:numberhow much percent to complete it?50
onComplete:functioncallback when complete

Features

  • Code Linting (eslint)
  • maintain if necessary