Socket
Socket
Sign inDemoInstall

react-otp-field

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.1.0

2

package.json
{
"name": "react-otp-field",
"version": "2.0.0",
"version": "2.1.0",
"description": "Customizable OTP Field component for the web built with React.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

# react-otp-field
[![npm version](https://img.shields.io/npm/v/react-otp-field)](https://www.npmjs.com/package/react-otp-field) [![npm](https://img.shields.io/npm/l/react-otp-field)](https://github.com/coded-bear/react-otp-field/blob/main/LICENSE) [![npm](https://img.shields.io/bundlephobia/minzip/react-otp-field)](https://www.npmjs.com/package/react-otp-field)
Customizable OTP Field component for the web built with React.js
[Live Demo](https://coded-bear.github.io/react-otp-field/)
## Installation
```
npm install --save react-otp-field
```
## Basic usage
```jsx
import React, { useState } from 'react';
import OtpField from 'react-otp-field';
const App = () => {
const [value, setValue] = useState('');
return (
<OtpField
value={value}
onChange={setValue}
numInputs={6}
onChangeRegex={/^([0-9]{0,})$/}
autoFocus
separator={<span>-</span>}
isTypeNumber
inputProps={{ className: 'otp-field__input', disabled: false }}
/>
);
};
```
## API

@@ -6,0 +40,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc