1.1.1 • Published 12 months ago

react-2fa-code v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-2fa-code

React component for inputing 2FA and other verification codes.

Installation

  npm install react-2fa-code

Usage

It's pretty easy to get it up and running!

import AuthCode from 'react-2fa-code'

function App() {
  return <AuthCode />
}

That's it! See API reference for props and default configuration.

Demo

npm.io

API Reference

PropTypeDefaultDescription
valueString""The value of the component
lengthNumber4The number of characters to be rendered
passwordBooleanfalseHide the inputted characters
disabledBooleanfalseDisable the component
allowPasteBooleanfalseAllow characters to be pasted from the clipboard
patternRegExp | String""The characters that are allowed
autoFocusBooleanfalseFocus the component as soon as it is rendered
containerClassNameString""CSS class name to add to the container
inputClassNameString""CSS class name to add to the inputs
OnChangeFunction-Callback function that gets called when the value of the component changes
OnCompleteFunction-Callback function that gets called when all characters have been inputted

License

MIT

Authors

1.1.1

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago

0.0.1

12 months ago