Socket
Socket
Sign inDemoInstall

@krmao/react-native-captcha

Package Overview
Dependencies
524
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @krmao/react-native-captcha

@krmao/react-native-captcha


Version published
Weekly downloads
12
decreased by-90%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-captcha

npm version

Preview

Capture

Installation

yarn add @krmao/react-native-captcha
yarn add react-native-gesture-handler
yarn add react-native-reanimated
yarn add react-native-get-random-values
yarn add crypto-js

Usage

import Captcha from '@krmao/react-native-captcha';

export default function App() {
  return (
    <SafeAreaView style={styles.root}>
      <ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollViewContainer}>
        <StatusBar translucent={true} backgroundColor={'#0000ff33'} barStyle={'dark-content'} />
      </ScrollView>
      <Captcha />
    </SafeAreaView>
  );
}

Props

export interface CaptchaProps {
  /**
   * 禁用滑块滑动, default false
   */
  disableSlider?: boolean;
  localBubbleBehindType?: LocalBubbleBehindType;
  /**
   * 校验的误差范围内算成功 default 3
   */
  maxOffset?: number;
  /**
   * 滑块尺寸 default 38
   */
  thumbSize?: number;
  /**
   * 弹窗尺寸 default 49
   */
  bubbleSize?: number;
  /**
   * 底图宽度 default 292
   */
  imageWidth?: number;
  /**
   * 底图高度 default 145
   */
  imageHeight?: number;
  verifyLocal?: (
    sliderCurrentProgress: number,
    randomBubbleXProgress: number,
    maxOffset: number,
    events: PanGestureHandlerEventPayload[],
    touchTime: number | undefined
  ) => boolean;
  verifyRemote?: (
    isVerifyLocalSuccess: boolean,
    slideValue: number,
    maxOffset: number,
    events: PanGestureHandlerEventPayload[],
    touchTime: number | undefined
  ) => Promise<boolean>;
  /**
   * sliding start
   */
  onSlidingStart?: () => void;
  onSlidingTouchBegin?: () => void;
  /**
   * on refresh clicked
   */
  onRefreshClicked?: () => void;
  onSlidingComplete?: () => void;
  /**
   * replace the all background image sources
   */
  imageBackgroundSources?: ImageSourcePropType[];
  /**
   * replace the all bubble image sources
   */
  imageBubbleSources?: BubbleSource[];
  /**
   * replace the refresh image sources
   */
  imageRefreshSource?: ImageSourcePropType;
  /**
   * 向右滑动滑块解锁拼图
   */
  defaultSliderText?: string;
}

Todo

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Keywords

FAQs

Last updated on 17 Apr 2024

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