captcha-text-generator
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Captcha Text Generator

This is a reactjs component for generating captcha text.

  • automatically generate random text
  • easy to validate
  • easy to customize the style

Basic usage

Install

npm i captcha-text-generator

Import the component to your code:

import { CaptchaText } from 'captcha-text-generator'

Add component to your code:

<CaptchaText
  length={5}
  onGenerated={(val) => console.log(val)}
/>

Props available:

You also can customize the style using bellow props:

  • height: height for the image
  • width: width for the image
  • textColor: color for the text
  • fontFamily: font family for the text
  • fontSize: font size for the text
  • paddingLeft: padding left for each text and first text between image
  • paddingTop: padding top between image and text
  • length: length for text, you can set as many as you want
  • background: background for the image
  • onGenerated: a callback function once it generated

/captcha-text-generator/

    Package Sidebar

    Install

    npm i captcha-text-generator

    Weekly Downloads

    236

    Version

    2.0.1

    License

    ISC

    Unpacked Size

    41.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • aripratomo