1.0.0 • Published 3 years ago

@ozuit/react-flashcard v1.0.0

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

react-flashcard

Flashcard React Component

NPM JavaScript Style Guide

Install

npm install --save react-flashcard

Usage

import React, { Component } from 'react'

import FlashcardComponent from 'react-flashcard'

const cardData = [
  {
    front: {
      text: "living outside, often in a tent",
      image: "https://o.quizlet.com/RWRdgDus.uuqNDUrJ0ernA.jpg",
    },
    back: {
      text: "Camping",
    }
  }
]

class Example extends Component {
  render() {
    return <FlashcardComponent dataSource={cardData} />
  }
}

Properties

PropsTypeDescriptionDefault
dataSourcearrayThe field is required. This includes text and image for the card content.
flipDirectionstringDirection of the card flip ('horizontal' or 'vertical' )horizontal
onChangefuncThis event is triggered by whenever change side (front/back) or navigation (prev/next)(step, size) => {}
onFinishfuncThis event is triggered when the user completes all question and click on the "Finish" button.() => {}
onSoundfuncThis event is triggered when the user clicks on the sound icon.(text) => {}

License

MIT © ozuit

1.0.0

3 years ago