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

vue-otp-2

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-otp-2

> A OTP input component for Vue

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53
decreased by-49.04%
Maintainers
1
Weekly downloads
 
Created
Source

VUE OTP INPUT

A OTP input component for Vue

DEMO: https://vue-otp-2-hoaitx.vercel.app/

NPM Version

Installation

npm i vue-otp-2

Usage example

In main.js

import Vue from 'vue'
import VueOtp2 from 'vue-otp-2';

Vue.use(VueOtp2)

In App.vue

<vue-otp-2
  length="6"
  join-character="-"
  inputmode="numeric"
  pattern="[0-9]*"
  @onChange="console.log"
  @onComplete="console.log" 
/>

Props

NameTypeDefaultDescription
lengthString6The number of input
join-characterStringcharacter to join inputs
inputmodeStringnumericnumeric/text
patternString[0-9]*HTML attribute: pattern

Events

NameDescription
onCompleteAll input typed
onChangeInput filled

Style

.vue-otp-2 {
  display: flex;
  justify-content: space-between;

  div {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    input {
      max-width: 30px;
      padding: 11.5px 8px;
      font-size: 20px;
      border-radius: 3px;
      border: 1px solid #cecece;
      text-align: center;
    }

    span {
      display: block;
      flex: 1;
      text-align: center;
    }
  }
}

Release History

1.0.3: Fixed some bugs & improvement

  • Fix: Keypress not working on Samsung devices
  • Added inputmode & pattern html input
  • Improvement style
  • And more...

1.0.2: Fixed some bugs

  • Fix: Event emit not correct

1.0.1: RELEASE

License

MIT

FAQs

Package last updated on 20 Oct 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