Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kumbhar-ketan/react-canvas-captcha
https://github.com/kumbhar-ketan/react-canvas-captcha
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kumbhar-ketan/react-canvas-captcha
- Owner: kumbhar-ketan
- Created: 2023-07-11T12:42:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-24T06:49:52.000Z (11 months ago)
- Last Synced: 2024-08-10T11:25:22.797Z (5 months ago)
- Language: JavaScript
- Size: 111 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Canvas Captcha
Add captcha to your react projects
![React Captcha Image](https://raw.githubusercontent.com/kumbhar-ketan/react-canvas-captcha/main/react-canvas-captcha.png)
## Installation
```bash
npm install react-canvas-captcha
```OR
```bash
yarn add react-canvas-captcha
```## Usage
```javascript
import Captcha from "react-canvas-captcha";const App = () => {
const [generatedCaptcha, setGeneratedCaptcha] = useState('');return (
setGeneratedCaptcha(captchaCode)}
/>
);
};export default App;
```## Parameters
Parameter Name | Default Value | Description
--- | --- | ---
boxHeight | 50 | Height of the canvas box
boxWidth | 130 | Width of the canvas box
refreshButton | false | Show or hide the refresh button. To show the refresh button make this "true"
caseType | mix | Use caseType to make the captcha code case sensitive or use mix. options (mix, uppercase, lowercase)
captchaConfig | { numberOfChars: 4, font: 'bold 23px Arial', textStartingX: 15, textStartingY: 5 } | Config for the box. Set the number of characters usinng prop "numberOfChars". Use "font" to set the font styling. Use "textStartingX" to set the horizontal starting point for characters inside the box. Use "textStartingY" to set the vertical starting point for characters inside the box.
setCode | | Use this function to get the new captcha code