Socket
Socket
Sign inDemoInstall

react-client-captcha

Package Overview
Dependencies
8
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-client-captcha

[![npm version](https://img.shields.io/npm/v/react-client-captcha.svg)](https://www.npmjs.com/package/react-client-captcha) ![Codecov](https://img.shields.io/codecov/c/github/majid-amiri/react-client-captcha?token=fa410599316a4368b4ecdb828baf6cbb) [![Buil


Version published
Maintainers
1
Weekly downloads
630
increased by4.83%

Weekly downloads

Readme

Source

react-client-captcha

npm version Codecov Build Status

A light JS-based captcha generator.

  • Custom characters.
  • Retry functionality.
  • Easily customizable via props.

Documentation

Installation

npm install react-client-captcha --save
or
yarn add react-client-captcha

Usage

Edit react-client-captcha

import React from "react";
import ReactDOM from "react-dom";
import ClientCaptcha from "react-client-captcha";

export default class App extends React.Component {
  render() {
    return <ClientCaptcha captchaCode={code => console.log(code)} />;
  }
}

ReactDOM.render(<App />, document.getElementById("app"));

Props

NameDescriptionTypeDefault
widthwidth of captcha image.number100
heightheight of captcha image.number40
fontSizefontSize of captcha characters.number22
fontFamilyfontFamily of captcha characters.string"Arial, Tahoma"
fontColorfontColor of captcha characters.string"#000"
charscharacters that captcha should be made with.string"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
charsCountcount of characters that captcha should be made with.number4
captchaCodefunction that returns current shown captcha code.func
backgroundColorbackgroundColor of captcha image.string"#F2F2F2"
retrywhether captcha has retry functionalitybooltrue
retryIconthe icon of retry buttonstring"https://cdn.jsdelivr.net/npm/react-client-captcha/dist/retry.svg"
retryIconSizesize of retry button iconnumber24
retryButtonClassNameclassName of retry buttonstringcssClasses.retryButton
retryImgClassNameclassName of retry imgstring""
containerClassNameclassName of captcha and retry button container divstringcssClasses.captchaContainer
captchaClassNameclassName of captcha imagestring""

Tests

Clone the project and run yarn test

License

MIT © Majid Amiri

FAQs

Last updated on 26 Aug 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc