nice-simple-captcha
v2.7.0
Published
Simple Captcha
Downloads
49
Readme
nice-simple-captcha
Simple Captcha
Install
npm install --save nice-simple-captcha
Online Demo
Visit this link: https://simacoders.ir/features/#NiceSimpleCaptcha
Usage
import {NiceSimpleCaptcha} from 'nice-simple-captcha'
import 'nice-simple-captcha/dist/index.css'
function Example() {
return (
<NiceSimpleCaptcha
className={''}
inputClassName={''}
screenColor='white'
screenBorderColor='black'
captchaColor='black'
characters={'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'}
length={5}
crossLine={true}
expireAfterSec={60}
caseSensetive={true},
style={{width: '200px'}}
refreshButtonIcon = {null}
onCaptchaValidate={(passed, messageCode) => captchaValidate(passed, messageCode)}
onEnterPressed={() => onEnterPressed()}
/>
)
}
General properties
import { CAPTCHA_OK, CAPTCHA_LOAD_ERROR, CAPTCHA_EMPTY_ERROR, CAPTCHA_MISMATCH_ERROR, CAPTCHA_EXPIRED } from 'nice-simple-captcha';
For reseting Captcha programmatically, create a ref using useRef and pass it to NiceSimpleCaptcha component. And then:
const refCaptcha = useRef();
refCaptcha.current.resetCaptcha();
License
MIT © mortezadvlp