New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-canvas-captcha

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-canvas-captcha

Add captcha to your react projects

  • 1.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-27.14%
Maintainers
0
Weekly downloads
 
Created
Source

React Canvas Captcha

Add captcha to your react projects

React Captcha Image

Installation

  npm install react-canvas-captcha

OR

  yarn add react-canvas-captcha

Usage

import Captcha from "react-canvas-captcha";

const App = () => {
  const [generatedCaptcha, setGeneratedCaptcha] = useState('');

  return (
    <Captcha
      boxHeight={50}
      boxWidth={130}
      refreshButton
      captchaConfig={{
        numberOfChars: 4,
        font: "bold 23px Arial",
        textStartingX: 15,
        textStartingY: 5,
      }}
      setCode={(captchaCode) => setGeneratedCaptcha(captchaCode)}
    />
  );
};

export default App;

Parameters

Parameter NameDefault ValueDescription
boxHeight50Height of the canvas box
boxWidth130Width of the canvas box
refreshButtonfalseShow or hide the refresh button. To show the refresh button make this "true"
caseTypemixUse 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.
setCodeUse this function to get the new captcha code

Keywords

FAQs

Package last updated on 27 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc