Git Product home page Git Product logo

react-native-otp-inputs's Introduction

react-native-otp-inputs

npm npm

Demo

Demo

Description

react-native-otp-inputs is fully customizable, React-Native package, that provides solution for One-time password feature with user friendly events like moving to previous input with backspace or going to next when filled in. It supports pasting and otp code into inputs

Installation

Supported version: react-native >= 0.59.0

Expo is currently not supported as Clipboard is not included in Expo SDK

$ yarn add react-native-otp-inputs @react-native-clipboard/clipboard

After installation run:

$ npx pod-install

Clipboard module has been extracted from react-native core, so it needs to be installed separately. Package uses it for autofill feature

For React Native version 0.59

React Native <= 0.59

run the following command to link the package:

$ react-native link @react-native-clipboard/clipboard

For iOS, make sure you install the pod file.

cd ios && pod install && cd ..

or you could follow the instructions to manually link the project

React-Native version version
0.53.0 - 0.56.1 yarn add [email protected]
0.57.0 - 0.58.6 yarn add [email protected]
+0.59.0 yarn add react-native-otp-inputs

Basic usage

import React, { Component } from 'react';
import { View } from 'react-native';
import OtpInputs from 'react-native-otp-inputs';

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <OtpInputs
          handleChange={(code) => console.log(code)}
          numberOfInputs={6}
        />
      </View>
    );
  }
}

Contributors

Great thanks to : @kantorm.

react-native-otp-inputs's People

Contributors

dependabot-preview[bot] avatar kantorm avatar dependabot[bot] avatar pixelize avatar vitalyiegorov avatar sataporn8063 avatar vish2595 avatar vinitkadam avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.