Skip to content

🔧 Props

<VueTelNumInput> accepts a large set of props to control behavior, appearance, and data sources. All props are optional — sensible defaults are provided.

Quick reference

PropTypeDefaultNotes
v-modelTelInputModelTyped object (value, iso, code, name, valid, etc.).
defaultCountryCodestring"US"Initial ISO2. Keep as fallback even with autodetect.
internationalbooleantruetrue+421 …, false → national (0xx) ….
displayName"english" | "native""english"Country label language.
countryCodesstring[][]Allowlist of ISO2 codes.
excludeCountryCodesstring[][]Blocklist of ISO2 codes.
placeholderstring | Record<string,string>"Enter phone number"Per-locale placeholders supported.

Core

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl" | "xxl""lg"Preset sizing. Affects row height, paddings.
disableSizingbooleanfalseTurns off built-in size classes (style from scratch).
itemHeightnumberderivedRow height in px; if unset, derives from size.
disabledbooleanfalseDisables the text input.
silentbooleanfalseSuppresses internal warnings.
animationNamestring"fade"<Transition :name> used for the dropdown.
initialValuestring""Initial raw input; useful for controlled hydration.
internationalbooleantrueFormat as international (+XX …) vs national.
displayName"native" | "english""english"Country label locale.
placeholderstring | Record<string,string>"Enter phone number"Input placeholder, single string or locale map.
localestringundefinedLocale key when placeholder is an object.

Countries

PropTypeDefaultDescription
countryCodesstring[][]Allowlist of ISO2 codes to show.
excludeCountryCodesstring[][]Blocklist of ISO2 codes to hide.
defaultCountryCodestring"US"Initial ISO2.
autoDetectCountrybooleanfalseBest-effort detection on mount; still set defaultCountryCode.

Flags

PropTypeDefaultDescription
flagFlagConfig{}Configure flag rendering strategy. Common fields: strategy: 'emoji' | 'sprite' | 'cdn', plus source options (e.g. baseUrl for CDN). See exported FlagConfig type.

Notes:

  • emoji: zero network, OS-dependent rendering.
  • sprite: consistent offline visuals; bundle your sprite.
  • cdn: tiny package, requires CORS-safe CDN.

Input options (input)

input is a nested object. Unspecified keys fall back to defaults below.

KeyTypeDefaultDescription
requiredbooleanfalseAdds HTML required. Also drives model.valid on empty.
clearOnCountrySelectbooleantrueClears input when user selects a different country.
focusAfterCountrySelectbooleantrueFocuses the text input after selection.
lockCountryCodebooleanfalsePrevents user from deleting/altering the prefix code.
formatterEnabledbooleantrueEnables AsYouType masking via libphonenumber-js.
maxLengthnumber | undefinedundefinedOptional character cap.

Example:

vue
<VueTelNumInput
  :input="{ required: true, lockCountryCode: true, maxLength: 18 }"
/>
KeyTypeDefaultDescription
hiddenbooleanfalseHides the search bar.
placeholderstring | Record<string,string>undefinedPlaceholder for search (supports locales).
localestringundefinedLocale key when placeholder is an object.
clearOnSelectbooleantrueClears query after selecting a country.
autoFocusbooleantrueFocus the search input when dropdown opens.

Prefix button (prefix)

KeyTypeDefaultDescription
hiddenbooleanfalseHide the entire prefix button.
hideCodebooleanfalseHide dialing code within the button.
hideFlagbooleanfalseHide flag within the button.
hideChevronbooleanfalseHide chevron icon.
hideCountryNamebooleanfalseHide country name label.

List / dropdown (list)

KeyTypeDefaultDescription
hiddenbooleanfalseHide the dropdown entirely.
hideCodebooleanfalseHide dialing code in rows.
hideFlagbooleanfalseHide flags in rows.
hideCountryNamebooleanfalseHide country names in rows.
itemsPerViewnumber5Max visible rows before scroll (derived from DEFAULT_ITEMS_PER_VIEW).
returnToSelectedbooleantrueScroll back to currently selected country when reopening.

Notes / caveats

  • Always set defaultCountryCode even with autoDetectCountry; detection is best-effort.
  • When input.required is true, empty value sets model.valid = false.
  • If you replace internal inputs via slots, keep v-model in sync (update model.value yourself).
  • itemHeight should match your visual density; otherwise use size presets.