Vue Tel Input

9.8.0 · active · verified Sun Apr 19

Vue Tel Input is a Vue.js component that provides an international telephone input field, integrating country code selection, formatting, and validation. It leverages `libphonenumber-js` for robust and accurate parsing, formatting, and validation of phone numbers according to international standards. The current stable version is `9.8.0`, with regular minor and patch releases addressing bugs, improving features like TypeScript support, accessibility, and updating underlying dependencies. Key differentiators include its dedicated Vue 3 support (with a separate legacy branch for Vue 2), flexible installation options (global plugin, local component, or lazy loading for performance), and comprehensive customization capabilities for styling and behavior. It offers a standardized solution for handling diverse international phone number inputs in web applications.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic usage of `vue-tel-input` as a local component within a Vue 3 setup script, binding its value to a reactive reference and importing the necessary styles.

<template>
  <vue-tel-input v-model="phone" mode="international"></vue-tel-input>
</template>

<script lang="ts">
  import { ref, defineComponent } from 'vue';
  import { VueTelInput } from 'vue-tel-input';
  import 'vue-tel-input/vue-tel-input.css';

  export default defineComponent({
    components: {
      VueTelInput,
    },
    setup() {
      const phone = ref<string | null>(null);
      return {
        phone,
      };
    },
  });
</script>

view raw JSON →