Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-auth-code-input

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-auth-code-input

A React Component for inputting Auth Codes inspired in Apple Two-Factor Authentication UI. It allows deleting using the backspace and pasting as well

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58K
increased by114.53%
Maintainers
1
Weekly downloads
 
Created
Source

image

React Auth Code Input

A React Component for inputting Auth Codes inspired in Apple Two-Factor Authentication UI. It allows deleting using the backspace and pasting as well.

NPM JavaScript Style Guide Software License npm npm

Demo

Demo

Install

npm install --save react-auth-code-input

or

yarn add react-auth-code-input

Usage

import React from 'react';
import AuthCode from 'react-auth-code-input';

const App = () => {
  return (
    <AuthCode
      characters={5}
      onChange={() => null}
      containerClassName='container'
      inputClassName='input'
    />
  );
};

Props

PropTypeDescriptionDefault ValueObservations
charactersNumberThe number of inputs to display6
allowedCharactersStringRegex for allowed characters^[A-Za-z0-9]
passwordBooleanIf present changes the type of the input to password, by default is set to textFalse
inputStyleObjectThe styles to be applied to each inputdeprecated since version 1.2.0
containerStyleObjectThe styles to be applied to the containerdeprecated since version 1.2.0
inputClassNameStringThe styles to be applied to each input
containerClassNameStringThe styles to be applied to the container
onChangeFunction(value: String)Callback function called every time an input value changes

Changelog

1.2.0

  • Add inputClassName and containerClassName props.
  • Deprecate inputStyle and containerStyle.
  • Make onChange prop mandatory.

1.1.0

  • Typescript support.

1.0.0

  • Initial Version.

License

Licensed under the MIT License, Copyright © 2020-present Luis Guerrero drac94.

See LICENSE for more information.

Keywords

FAQs

Package last updated on 06 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc