π Getting Started β
Welcome to Vue Tel Num Input β a fully customizable Vue 3 component for phone number input with country selection, flags, masks, and localization.
π¦ Installation β
First, install the component and its peer dependency:
bash
npm i libphonenumber-js vue-tel-num-input
βΉοΈ Uses libphonenumber-js under the hood for formatting and validation.
Then import component and minimal styles in your .vue
file:
ts
import VueTelNumInput from "vue-tel-num-input";
import "vue-tel-num-input/css";
β‘ Quick Start β
vue
<script setup lang="ts">
import { ref } from "vue";
import VueTelNumInput from "vue-tel-num-input";
const phone = ref("");
</script>
<template>
<VueTelNumInput v-model="phone" default-country-code="US" />
</template>
Thatβs it π You now have a fully functional phone number input.
π§Ύ Why Vue Tel Num Input? β
- Flexible by default β good defaults, full customization when needed
- Composability β bring your own flags, masks, and data sources
- DX-first β clean props, typed model, documented events & slots
- Performance-aware β lazy assets, optional virtual scroll