vue3-tel-input is a Vue 3 component designed to provide an international telephone input field. It features an integrated country flag dropdown, automatic formatting, and adherence to international dialing standards. The current stable version is 1.0.4. While a specific release cadence isn't published, the project appears actively maintained with recent updates. A key differentiator is its explicit compatibility with Vue 3's composition API and global application setup, moving beyond older Vue versions. It supports both global plugin installation with default options and local component registration for fine-grained control, and requires a separate CSS import for styling. It allows filtering countries and setting preferred countries, making it flexible for various internationalization needs.
npm install vue3-tel-inputVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates both global registration and local component usage with `v-model` binding, preferred/only countries, and event handling for validation data.
Ensure your project is a Vue 3 application. If migrating from Vue 2, use `createApp` for initialization. For Vue 2, use a compatible `vue-tel-input` package.
Avoid using the `vue-form-generator` integration examples if your project is Vue 3. Instead, integrate the component directly into your Vue 3 forms.
Always include `import 'vue3-tel-input/dist/vue3-tel-input.css';` in your main entry file or the component where `vue-tel-input` is used.
For global usage: `import VueTelInput from 'vue3-tel-input'; app.use(VueTelInput);`. For local usage: `import { VueTelInput } from 'vue3-tel-input'; components: { VueTelInput }`.Ensure you are using `createApp` to initialize your Vue 3 application instance. For browser usage, confirm that Vue 3 is globally available before attempting `app.use(VueTelInput)`.
Ensure the variable bound to `v-model` is a `ref` or `reactive` object from Vue's reactivity system. For example: `const phoneNumber = ref('');` in `<script setup>` or `data() { return { phoneNumber: '' } }` in options API.No dependency data recorded yet.