A very useful pure javascript library to creating pin code inputs.
npm install pincode-inputA very useful pure javascript library to creating pin code inputs.
Inspired by vue-pincode-input
``bash`
npm i pincode-input
`js`
import PincodeInput from 'pincode-input'
import 'pincode-input/dist/pincode-input.min.css'
`html
`
`html`
`js`
new PincodeInput('#demo', {
count: 4,
secure: false,
previewDuration: 200,
onInput: (value) => {
console.log(value)
}
})
| Name | Type | Default | Description |
| :-------------- | :------ | :------ | :--------------------------------------------------------------------- |
| count | number | 4 | Count of the cells. |
| secure | boolean | false | Set to true to use the inputs with type="password" |secure: true` |
| previewDuration | number | 200 | Duration of the character preview. Valid when used with
| numeric | boolean | true | Do the inputs only accept numbers? |
| uppercase | boolean | true | Convert the characters to uppercase? |
| Name | Description |
| :------ | :--------------------- |
| onInput | Returns current value. |