0.0.8 • Published 1 year ago

react-native-agmcaptchalite v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

React Native AGM Captcha Lite

A simple and customizable Captcha provider for React Native.

Installation

Install the package using npm:

npm install agm-captcha-lite

USAGE

import React, { useRef } from 'react';
import { Button } from 'react-native';
import Captcha from 'agm-captcha-lite';

const YourComponent = () => {
  const captchaRef = useRef(null);

  const captchaHandle = () => {
    const captchaResult = captchaRef.current.captchaChecking();

    // If the user enters the correct captcha, captchaResult is true; otherwise, false
  };

  return (
    <Captcha
      ref={captchaRef}
      inputStyle={{ /* your custom input style */ }}
      captchaContainerStyle={{ /* your custom container style */ }}
      refreshButtonStyle={{ /* your custom refresh button style */ }}
      refreshIconColor="blue"
      isSpecialCharacterInclude={false}
      captchaLength={6}
    >
      <Button onPress={captchaHandle}>Click</Button>
    </Captcha>
  );
};

export default YourComponent;
PropTypeDescription
inputStyleTextStyleCustomize the style of the input field.
containerStyleViewStyleCustomize the style of the component container.
captchaContainerStyleViewStyleCustomize the style of the captcha container.
refreshButtonStyleViewStyleCustomize the style of the refresh button.
refreshIconColorstringCustomize the color of the refresh button icon.
isSpecialCharacterIncludebooleanSet to false to exclude special characters (default is true).
captchaLengthnumberChoose the length of the captcha (default is 5).
refreshIconReact.ReactNodeCustom refresh icon component.
0.0.8

1 year ago