Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-canvas-captcha
Advanced tools
Readme
Add captcha to your react projects
npm install react-canvas-captcha
OR
yarn add react-canvas-captcha
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;
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 |
FAQs
Add captcha to your react projects
The npm package react-canvas-captcha receives a total of 32 weekly downloads. As such, react-canvas-captcha popularity was classified as not popular.
We found that react-canvas-captcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.