New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

angular-otp-box

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-otp-box

Angular otp input field component for web applications. Easy to integrate and use.

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
93
52.46%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Otp input Library

Angular otp input field component for web applications. Easy to integrate and use.

Demo

Live Demo

Installation

npm i angular-otp-box

Usage

Add AngularOtpLibModule in app.module.ts

import { AngularOtpLibModule } from 'angular-otp-box';
import { NgModule } from  '@angular/core';
import { AppComponent } from  './app.component';

    @NgModule({
    declarations: [AppComponent],
    imports: [NgOtpInputModule],
    bootstrap: [AppComponent]
    })

In component add following:

<otp [setting]="settings" (onValueChange)="onInputChange($event)"></otp>

API

NameTypeDefaultRequiredDescription
settingobject{ length:4, timer: 0 }trueconfigurations to configure the component
onValueChangefunction--trueEmitter that will emit otp, -1 when the timer reaches 0 count and -2 when resend button is clicked

setting options

NameTypeDefaultRequiredDescription
lengthnumber4trueNumber of OTP inputs
numbersOnlyboolean--falseset true to allow only numbers as input
inputClassstring--falseClass applied to each input.
wrapperClassstring--falseClass applied to wrapper element.
inputStylesobject--falseStyle applied to each input.Check [ngStyles](https://angular.io/api/common/NgStyle) for more info.
wrapperStylesobject--falseStyle applied to wrapper element.Check [ngStyles](https://angular.io/api/common/NgStyle) for more info.
allowKeyCodesstring[]--falseBy default numbers alphabets and _ - are allowed.Y ou can define other key codes if needed.
timernumber0falseCountdown for otp
btnClassstring--falseClass applied to resend otp button

License

MIT

Keywords

ngx split-input-otp

FAQs

Package last updated on 06 Jun 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