1.0.3 • Published 5 years ago

combination-lock-react v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

React Combination Lock

React Component implement simple draggable combination lock

NPM

Demo

Install

npm install combination-lock-react

Usage

import React from 'react'
import CombinationLock from 'combination-lock-react'
import 'combination-lock-react/dist/index.css'

const App = () => (
  <div>
    <CombinationLock 
      code='01234' 
      height={70} 
      onMatch={() => { console.log('Unlock!') }}
      openText={'Unlocked!'}
    />
  </div>
);

export default App;

Props

PropsTypeDefaultDescription
combinationstring'01234'Correct combination (also response for the number of columns)
heightnumber80Column height (also response for font size)
openTextstring''Text to be shown on combination match
onMatchfunction() => {}Callback function on combination match
mainClassstringcombination-lockCSS class name of component

License

MIT © alexeyivanov94 <alexey.iva94@gmail.com>