Installation
npm install --save @encoreskytech/ng-otp-input-box
Usage
Add NgOtpInputBoxModule to imports app.module.ts
something like
import { AppComponent } from './app.component';
import { OtpInputBoxModule } from '@encoreskytech/ng-otp-input-box';
@NgModule({
declarations: [AppComponent],
imports: [OtpInputBoxModule]
})
Add component to your page:
<ng-otp-input-box [otpLength]="6" [onlyNumber]="false" [upperCase]="true" [mask]="false" (onInputChange)="fetchOTPvalue($event)" ></ng-otp-input-box>
API
Name | Type | Required | default | Description |
---|
otpLength | Boolean | false | 6 | Length of the otp |
onlyNumber | Boolean | false | -- | To allow only integer values |
upperCase | Boolean | false | -- | To make input field capitalize |
mask | Boolean | false | -- | To make input field as password |
onInputChange | function | true | -- | Function that will receive the otp |
Contributor
Mahesh Soni