Giter Site home page Giter Site logo

trendingtechnology / vue-pincode-input Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seokky/vue-pincode-input

0.0 1.0 0.0 1.07 MB

Great pincode input component

Home Page: https://seokky.github.io/vue-pincode-input/

License: MIT License

JavaScript 18.42% HTML 4.80% Vue 51.85% TypeScript 24.92%

vue-pincode-input's Introduction

vue-pincode-input

Great pincode input component for Vue.js applications.

vue-pincode-input

Demo on GitHub Pages

Features

  • configurable length (symbols count)
  • override-friendly styles
  • auto moving focus when filling
  • auto moving focus when deleting
  • auto selecting cell content on focusing
  • call for native numeric keyboard on mobiles
  • optional secure mode (password input type)
  • character preview on typing (configurable duration)

Attention!

Styles that component have are written just for demo. But that styles are override-friendly, so you can write any styles you want.

Usage

  npm i --save vue-pincode-input

or with yarn

  yarn add vue-pincode-input

Then in any component:

import PincodeInput from 'vue-pincode-input';
// The name can be different depending on your desire
<div class="input-wrapper">
  <PincodeInput
    v-model="code"
    placeholder="0"
  />
</div>

Attention: you should use 'input.vue-pincode-input' instead '.vue-pincode-input' in order to rule specificity was higher

<style>
div.vue-pincode-input-wrapper {
  // any styles you want for wrapper
}

input.vue-pincode-input {
  // any styles you want for each cell
}
<style>

Props

  • length (symbols count)

    • type: Number
    • default: 4
  • autofocus (auto focus first cell)

    • type: Boolean
    • default: true
  • secure (password input type)

    • type: Boolean
    • default: false
  • characterPreview (preview character on typing)

    • type: Boolean
    • default: true
  • previewDuration (duration of character preview)

    • type: Number
    • default: 300

ToDo

  • configure husky
  • write unit tests for v0.1.0 (secure prop)
  • write unit tests for v0.2.0 (characterPreview and previewDuration props)
  • write unit tests for pasting data

vue-pincode-input's People

Contributors

seokky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.