react-verification-code-input-2

🎉A verification code input

Usage no npm install needed!

<script type="module">
  import reactVerificationCodeInput2 from 'https://cdn.skypack.dev/react-verification-code-input-2';
</script>

README

react-verification-code-input

🎉A verification code input

NPM JavaScript Style Guide

NPM

This package is a fork https://github.com/suweya/react-verification-code-input I made a new package, because the author of the old one has probably stopped updating it and didn't accept my pull request, and I needed to add some features

Live demo

Install

npm install --save react-verification-code-input

Usage

import React, { Component } from 'react';

import ReactCodeInput from 'react-verification-code-input';

class Example extends Component {
  render() {
    return <ReactCodeInput />;
  }
}

PropTypes

Key Type Desc
type text one of number or text
fields number The count of characters
onChange func Trigger on character change
onComplete func Trigger on all character inputs
fieldWidth number input width
fieldHeight number input height
autoFocus bool auto focus first input on init
title string code input title
loading bool show loading flag
className string class name
values array default values
placeholder array input placeholder

License

MIT © suweya