react-puzzle-confirm
v1.0.17
Published
React confirm modal, by fitting puzzle piece
Downloads
12
Maintainers
Readme
React Puzzle Confirm
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/eact-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="Error"
successMessage="Success"
closeButtonLabel="Close"
refrefButtonLabel="Refresh"
disableRefreshIdleState={false}
/>
)
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 [email protected] -S
or
npm install [email protected] -S
Thanks
Yusuf Özlü