ng-custom-captcha
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

/** Copyright 2024 Infosys Ltd. */

NGX-CUSTOM-CAPTCHA

Now, uou can implement client side captcha easily. Just install this library and use selector

<ng-custom-captcha></ng-custom-captcha>

Below customizations are available with our library:

  • isValid: isValid event will return the status of validation as a boolean. true represents Enterred Captcha is valid and false represents Enterred Captcha is invalid.
<ng-custom-captcha (isValid)="onVerify($event)"></ng-custom-captcha>
  • placeholder: Passing a placeholder will reflect in input field. It's default value is Enter Captcha.
<ng-custom-captcha [placeholder]="placeholderValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • btnText: Passing a btnText will reflect at verify button. It's default value is Verify.
<ng-custom-captcha [btnText]="btnTextValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • charType: Passing a charType will decide if captcha text will Alphabets or Number. By default, it is alphanumeric. Allowed Values are alpha, numeric and alphanumeric.
<ng-custom-captcha [charType]="charTypeValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • charCase: Passing a charCase will decide if captcha text will Uppercase or Lowercase. By default, it is mixed. Allowed Values are upper, lower and mixed.
<ng-custom-captcha [charCase]="charCaseValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • bgColor: Passing a bgColor will reflect as background color of captcha. It can be a string(one color) or an array of string(multiple colors will form a gradient). By default, it is black.
<ng-custom-captcha [bgColor]="bgColorValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • fontColor: Passing a fontColor will reflect as font color of captcha. It can be a string(one color) or an array of string(multiple colors will be assigned randomly to each letter). By default, it is white.
<ng-custom-captcha [fontColor]="fontColorValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • strokeColor: Passing a strokeColor will reflect as stroke color behind captcha text. It can be a string(one color) or an array of string(multiple colors will be assigned randomly to each stroke). By default, it is red.
<ng-custom-captcha [strokeColor]="strokeColorValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • iconColor: Passing a iconColor will reflect as color of refresh and verify buttons. It can be a string(one color). By default, it is black.
<ng-custom-captcha [iconColor]="iconColorValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • gradient: Passing a gradient will decide the direction background gradient with cors passed in bgColor. By default, it is right. Allowed Values are left, right, top and bottom.
<ng-custom-captcha [gradient]="gradientValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • fontFamily: Passing a fontFamily will reflect as font in captcha image. It's default value is Roboto Mono.
<ng-custom-captcha [fontFamily]="fontFamilyValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • strokes: Passing a strokes will reflect as number of strokes in background of captcha image. It's default value is 5[Strictly a number].
<ng-custom-captcha [strokes]="strokesValue" (isValid)="onVerify($event)"></ng-custom-captcha>
  • refreshInterval: Passing a refreshInterval will reflect as minutes at which captcha will auto refresh. It's default value is 1[Strictly a number].
<ng-custom-captcha [refreshInterval]="refreshIntervalValue" (isValid)="onVerify($event)"></ng-custom-captcha>

Thank You! Buy me a Coffee if it helped you in any way ;)

Package Sidebar

Install

npm i ng-custom-captcha

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

149 kB

Total Files

16

Last publish

Collaborators

  • rajneesh4044
  • ppmkannan
  • akshayinfy