# vue3-phone-input

> ## Description :

Latest version **0.1.7** (published 2021-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue3-phone-input
pnpm add vue3-phone-input
yarn add vue3-phone-input
bun add vue3-phone-input
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2021-12-07 |
| First published | 2021-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 352.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | riderx |
| Keywords | vue.js 3, vuejs 3, phone, phone number, telephone, mobile, vue component, libphonenumber, web component |

## Links

- npm: https://www.npmjs.com/package/vue3-phone-input
- Repository: https://github.com/boussadjra/vue3-phone-input
- Homepage: https://boussadjra.github.io/vue3-phone-input/
- Issues: https://github.com/boussadjra/vue3-phone-input/issues
- npm.io page: https://npm.io/package/vue3-phone-input

## Dependencies (3)

- [vue](https://npm.io/package/vue.md) ^3.0.0
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [libphonenumber-js](https://npm.io/package/libphonenumber-js.md) ^1.9.6

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2021-12-07
- 0.1.6 — 2021-12-07

## README

# vue3-phone-input

## Description :

It's a rich component that allows you to type a validate phone number, this component is based on [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js), this component supports only Vue.js 3.x



## Installation 

    npm install vue3-phone-input --save

## DEMO 


[LIVE DEMO](https://boussadjra.github.io/vue3-phone-input/)

[Boilerplate](https://codesandbox.io/s/vue3-phone-input-l91zs?file=/src/App.vue)


## Usage 

```js
<template>
  <div class="w-full h-full p-16">
    <label for="phone">
      <div class="py-2 text-gray-600">Your phone number :</div>
      <vue3-phone-input v-model="phone" outlined id="phone" />
    </label>

    <div class="max-w-md py-8">
      <code class="whitespace-pre-line">
        {{ phone }}
      </code>
    </div>
  </div>
</template>

<script >
import { defineComponent } from "vue";
import VueyePhoneInput from "vue3-phone-input";

export default defineComponent({
  name: "app",
  components: {
    VueyePhoneInput,
  },
  data() {
    return {
      phone: {
        number: "",
        nationalNumber: "",
        isValid:false
      },
    };
  },
});
</script>

```

## Props:


|Name|default|description|
|---------|-------|------|
|v-model |`null`| the two-way bound value |
|shape | `'rounded'` | define the component shape (`rounded`,`rounded-none`,`rounded-full`)|
|outlined | `false`| show the component with/out an outline |
|raised| `false`| add an elevation to the component|
|status| `''`|Specify the input status (`'error'`, `'success'` or `''`)|
|placeholder| `''`|The input placeholder|


## Events :

|Name|description|params|
|---------|-------|------|
|blur | Triggered on blur event| `(e:Event)=>{}`|
|focus | Triggered on focus event|`(e:Event)=>{}`|
| click-dropdown | Triggered on open dropdown|`(e:Event,showDropdown:Boolean)=>{}`|
| click-dropdown | Emitted on selecting new country|`(e:Event,country:{name: string,nativeName: string, callCode: number | null, flag: string,code: string})=>{}`|


### Credits :

Thanks to the maintainers of :

- [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js)
- [restcountries](https://restcountries.eu/)
- [ip2c](https://ip2c.org/s)
-

Coded with  ❤  by Boussadjra Brahim

---
_Source: https://npm.io/package/vue3-phone-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
