Skip to content
React confirm modal, by matching puzzle piece
CSS JavaScript HTML
Branch: master
Clone or download
Latest commit 466833a Sep 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public add missing files Sep 21, 2019
src fix style of bottom missing part Sep 22, 2019
.babelrc add-files Sep 21, 2019
.gitignore add-files Sep 21, 2019
README.md Update README.md Sep 25, 2019
bg.png add-files Sep 21, 2019
index.js
package-lock.json fix style of bottom missing part Sep 22, 2019
package.json fix style of bottom missing part Sep 22, 2019
react-puzzle-confirm.css fix style of bottom missing part Sep 22, 2019
react-puzzle.gif add gif Sep 21, 2019
yarn.lock add-files Sep 21, 2019

README.md

React Puzzle Confirm

npm version

dependencies

 "react": "^16.9.0",
 "react-dom": "^16.9.0"

<ReactPuzzleConfirm />

Demo

Code Sandbox

install

Install as a node module

npm i react-puzzle-confirm -S

usage

import React from 'react'
import ReactPuzzleConfirm from 'react-puzzle-confirm'
import 'react-puzzle-confirm/react-puzzle-confirm.css'

const Demo = () => (
  <ReactPuzzleConfirm
     onClose={() => setShowModal(false)}
     onSuccess={() => setShowModal(false)}
     onFail={() => console.log("failed")}
     title="Please fit the puzzle piece carefully"
     sliderTitle="Slide to complete the puzzle"
     failMessage="Failed"
     successMessage="Success"
     closeButtonLabel="Close"
     refrefButtonLabel="Refresh"
     disableRefreshIdleState={true}
  />
)

export default Demo

props

onSuccess function

default () => console.log('success')

function for successful attempt

onFail function

default () => console.log('fail')

function for failed attempt

onClose function

default () => console.log('close clicked')

function for close button click

title string

default "Please fit the puzzle piece carefully"

sliderTitle string

default "Slide to complete the puzzle"

failMessage string

default"Error"

successMessage string

default"Success"

closeButtonLabel string

default"Close"

refrefButtonLabel string

default "Refresh"

disableRefreshIdleState boolean

default true

important note

For older versions of React 15.0.0 and above (^15.0.0) please install following version with tag react-v15.0.0 or 1.0.16

npm install react-puzzle-confirm@react-v15.0.0 -S

or

npm install react-puzzle-confirm@1.0.16 -S

Thanks

Yusuf Özlü

You can’t perform that action at this time.