Captcha Image Generator
A simple captcha image generator.
Install
npm install captcha-image
yarn add captcha-image
Example
Play with sandbox example here: Demo
Options
You can pass following parameters to Captcha instance in order to generate custom Captcha image
Attributes | Values |
---|---|
font / String | '35px Arial' |
align / String | 'center' |
baseline / String | 'middle |
width / Number | 300 |
height / Number | 150 |
bgColor / String | #eee |
color / String | #222 |
length / Number / Length of text | 7 |
Events
- createImage() method return HTML element parsed as String
Output
Final outcome looks like this:
Demo Usage
React
; const captchaImage = '35px Arial' 'center' 'middle' 300 150 '#eee' '#111' 6; { return __html: source ;} { return <div dangerouslySetInnerHTML= />;} { return <div className='App'> <MyCaptcha /> </div> ;} ;