0.0.8 • Published 1 year ago
react-native-agmcaptchalite v0.0.8
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;
Prop | Type | Description |
---|---|---|
inputStyle | TextStyle | Customize the style of the input field. |
containerStyle | ViewStyle | Customize the style of the component container. |
captchaContainerStyle | ViewStyle | Customize the style of the captcha container. |
refreshButtonStyle | ViewStyle | Customize the style of the refresh button. |
refreshIconColor | string | Customize the color of the refresh button icon. |
isSpecialCharacterInclude | boolean | Set to false to exclude special characters (default is true ). |
captchaLength | number | Choose the length of the captcha (default is 5 ). |
refreshIcon | React.ReactNode | Custom refresh icon component. |
0.0.8
1 year ago