An open API service indexing awesome lists of open source software.

https://github.com/qzruncode/react-vitual-keyboard

react vitual keyboard
https://github.com/qzruncode/react-vitual-keyboard

mobile-app react typescript

Last synced: 3 months ago
JSON representation

react vitual keyboard

Awesome Lists containing this project

README

          

keyboard

[![NPM version](https://img.shields.io/npm/v/react-vitual-keyboard.svg)](https://www.npmjs.com/package/react-vitual-keyboard)
[![NPM package](https://img.shields.io/npm/dy/react-vitual-keyboard.svg)](https://www.npmjs.com/package/react-vitual-keyboard)

## react-vitual-keyboard

For mobile captcha virtual keyboard, using HTML5 instead of native development

### Install
```
npm install react-vitual-keyboard --save
```

### Usage
```
import React from 'react';
import CodeInput from 'react-vitual-keyboard';
import styles from './index.scss';

interface IProps {
}
interface IState {
show: boolean;
}
const rightCode = [8, 8, 8, 8];
class App extends React.Component {
constructor(props: IProps) {
super(props);
this.state = { show: false };
}

public handleInput(numbers: number[]) {
console.log('The user is typing', numbers);
}

public handleFinish(numbers: number[]) {
console.log('User input completed', numbers);
}

public handleSendCode() {
console.log('User click please send verification code');
return false; // If the captcha is successfully obtained return true
}

public render() {
return (


this.setState({show: true})}>open

this.setState({show})
}
onInput={this.handleInput} // optional (The callback being entered)[function]
onFinish={this.handleFinish} // optional (Enter the completed callback)[function]
onSendCode={this.handleSendCode} // optional (Send verification code)[function]
onValidation = (nubmers) => Promise.resolve('ok') // The captcha is entered correctly
/>

);
}
}
export default App;
```

### Development
> You can download the source code and modify it yourself from github [react-vitual-keyboard](https://github.com/qzruncode/react-vitual-keyboard)

```
npm install
npm run serve
npm run build
```