
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
react-canvas-captcha
Advanced tools
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 50 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.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.