1.0.0 • Published 4 years ago

react-verification-code-virtual-keyboard v1.0.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
4 years ago

react-verification-code-virtual-keyboard

NPM version Build Status Coverage Status code style: prettier

Based on antd-mobile Modal, InputItem. Use css border-image instead of border. Developed a four-digit verification code input box with virtual keyboard and pasting functions.

Install

yarn

yarn add react-verification-code-virtual-keyboard

npm

npm install --save react-verification-code-virtual-keyboard

UMD

<script src="https://unpkg.com/react-verification-code-virtual-keyboard@1.0.0/dist/react-verification-code-virtual-keyboard.umd.js"></script>

Tips: You can find the library on window.ReactVerificationCodeVirtualKeyboard.

Import

ES2015

import ReactVerificationCodeVirtualKeyboard from 'react-verification-code-virtual-keyboard'

CommonJS

const ReactVerificationCodeVirtualKeyboard = require('react-verification-code-virtual-keyboard')

Usage

import ReactVerificationCodeVirtualKeyboard from 'react-verification-code-virtual-keyboard'

function Example() {
  return (
    <ReactVerificationCodeVirtualKeyboard
      visible={true}
      onClose={() => {}}
      maskClosable={true}
      headerLeftContent={[<b key="X">X</b>]}
      headerTitle="验证码标题"
      headerRightContent={[]}
      tipMessage="验证码提示信息"
      onInputChange={() => {}}
      isCodeImmediatelySendVerify={true}
      onSendVerifyCode={() => {}}
    >
      {/** List only children or Null */}
    </ReactVerificationCodeVirtualKeyboard>
  )
}

Params

PropertyDescriptionTypeDefaultisRequired
visibleShow Modal Verification Code UIbooleanfalsetrue
onCloseClose Modal Verification Code UI (Default clear countdown)functionundefinedtrue
maskClosableWhether the mask layer of modal is clickablebooleantruefalse
headerLeftContentLeft half of headJSX.Element[][]false
headerTitletitleJSX.Element | string
'请输入验证码'false
headerRightContentRight half of headJSX.Element[][]false
tipMessageTipsJSX.Element | string'验证码'false
onInputChangeInput Box handle change valuefunctionundefinedfalse
isCodeImmediatelySendVerifyWhether to send the verification code immediately when the modal pops upbooleanfalsefalse
onSendVerifyCodeIf the isCodeImmediatelySendVerify value is true, auto excute onSendVerifyCode. 点击获取验证码,将执行此函数。functionundefinedtrue

LICENSE

GPL v3 License