vue-split-input
Vue Split input for otp verification etc
1,534
10
| Install | |
|---|---|
npm install vue-split-input |
|
| Latest Version: | 1.4.1 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 20, 2026 |
| Links: | GitHub · npm |
Maintainer: damilaredev
Split Input Component for Vue 3.x
Used for otps, transaction pin, passwords etc
Install
NPM
//with npm
npm i vue-split-input --save
//with yarn
yarn add vue-split-input
//with pnpm
pnpm i vue-split-input
Usage
import { createApp } from 'vue';
import Root from './App.vue'
import SplitInput from 'vue-split-input';
const app = createApp(App)
app.use(SplitInput)
app.mount('#app')
Props
| Props | #Type | #default | #description |
|---|---|---|---|
| inputNumber | Number | 6 | Number for input rendered |
| type | String as PropType<'tel', 'password', 'text'> | 'tel' | Input type. Optional value: password, text |
| className | String | '' | Custom class/style for each input |
| disabled | Boolean | false | Disabled all input |
| placeholder | String | '' | Default description for each input |
| placeholders | Array | null | Default description for all inputs |
Events
| Name | #Description |
|---|---|
| focus | custom focus method that passes the input event as an argument |
SplitInput.vue Usage
<template>
<split-input
v-model="input"
class-name="w-12 h-8 rounded-sm p-5 font-bold text-lg"
:input-number="4"
/>
</template>
Or
<script lang="ts">
export default defineComponent({
template: `
<split-input
v-model="input"
class-name="w-12 h-8 rounded-sm p-5 font-bold text-lg"
:input-number="4"
/>
`,
});
</script>
You can also pass a ref to access the component dom and objects directly
<script setup lang="ts">
import { ref } from 'vue';
import type { ComponentPublicInstance } from 'vue';
import type { Prop } from 'vue-split-input';
const input = ref<ComponentPublicInstance<Prop> | null>(null);
const clear = () => input.value?.clearAllInput();
</script>
<template>
<split-input
ref="input"
v-model="input"
class-name="w-12 h-8 rounded-sm p-5 font-bold text-lg"
:input-number="4"
/>
<button
type="button"
@click="clear"
class="px-6 bg-blue-500 text-white text-xs ml-2"
>
CLEAR ALL
</button>
</template>
Thanks! Damilare.
Related Packages
@hauzhengyi/vue3-otp-input
A fully customizable, OTP (one-time password) input component built with Vue 3.x...
677
124
vue3-otp-input
A fully customizable, OTP (one-time password) input component built with Vue 3.x...
1,537,033
124
@altgr4m/vue3-one-time-password
Customizable OTP (One Time Password) is a 23kB lightweight component for web app...
1,349
0
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.4.1 | ^3.* | MIT | |
| 1.3.1 | ^3.* | MIT | |
| 1.2.0 | ^3.* | MIT | |
| 1.1.2 | ^3.2.* | MIT | |
| 1.1.0 | ^3.2.* | MIT | |
| 1.0.9 | 3.2.29 | MIT | |
| 1.0.8 | 3.2.29 | MIT | |
| 1.0.7 | 3.2.29 | MIT | |
| 1.0.6 | 3.2.29 | MIT | |
| 1.0.5 | 3.2.29 | MIT | |
| 1.0.4 | 3.2.29 | MIT | |
| 1.0.3 | 3.2.29 | MIT | |
| 1.0.2 | 3.2.29 | MIT | |
| 1.0.1 | 3.2.29 | MIT | |
| 0.9.35 | 3.2.28 | MIT | |
| 0.9.34 | 3.2.27 | MIT | |
| 0.9.32 | 3.2.26 | MIT | |
| 0.9.31 | 3.2.26 | MIT | |
| 0.9.0 | 3.2.23 | MIT | |
| 0.8.0 | 3.2.22 | MIT | |
| 0.7.0 | ^3.2.20 | MIT | |
| 0.6.0 | ^3.2.20 | MIT | |
| 0.5.0 | ^3.2.20 | MIT | |
| 0.0.1 | MIT |