1.0.2 • Published 5 years ago

ad-pattern-lock v1.0.2

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

ADPatternLock

An react library for android like pattern lock for your web app. It's highly customizable according to your need.

Installation

npm install ad-pattern-lock

How to use

import React, { Component } from "react";
import AdPatternLock from "ad-pattern-lock";
import 'ad-pattern-lock/dist/main.css';

// in you render method
<AdPatternLock onCompletePattern={(pattern) => {console.log(pattern)}/>

Props API

propsdefaultDescription
matrix3,3m*n grid for the pattern
backgroundColor#556b2fBackground color for the pattern
allowRepeatfalseWill allow repetition of dots if true
delimiterDelimeter used in pattern output
patternDotsBackgroundColor#fffbackground color for the inner dots of pattern circle
patternDotsRadius5radius for the pattern dots
patternCircleRadius25radius for the pattern circle
patternCircleMargin20margin for the pattern circle (margin and radius used to calculate width and height of the pattern component)
patternCircleVisiblefalseif true circle surrounds the pattern dots
patternCircleVisibleBorder"3px solid #fff"border property for pattern circle
patternCircleHoverVisiblefalseif true circle surrounds the pattern dots on hover
patternCircleHoverBorder"3px solid #afeeee"border property for pattern circle on hover
patternLinesHeight10height of the pattern linesusually double of radius of pattern dots
patternLinesBackgroundColorrgba(255,255,255,.7)color of pattern lines
minimumPatternLength2minimum pattern length
onCompletePatternnullcallback to receive the pattern seperated by the delimeter

License

Copyright (c) 2019

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago