Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
/ react-scratchcard Public archive

React component for displaying a scratch card in your web app.

Notifications You must be signed in to change notification settings

aleksik/react-scratchcard

Repository files navigation

react-scratchcard

A react component for displaying scratch card in your web app.

Demo

http://allu.io/react-scratchcard

Installation

$ npm install react-scratchcard

Example

import React from 'react';
import ScratchCard from 'react-scratchcard';

const settings = {
  width: 640,
  height: 480,
  image: 'image.jpg',
  finishPercent: 50,
  onComplete: () => console.log('The card is now clear!')
};

const Example = () =>
  <ScratchCard {...settings}>
    Congratulations! You WON!
  </ScratchCard>;

Credits

Heavily inspired by this pen by André Ruffert.

Image used in the example by webtreats.

About

React component for displaying a scratch card in your web app.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •