Phone
International (E.164) numbers: + and up to 15 digits; typing +90 switches to the Turkish layout. For Turkish input use country: "TR".
← All examples·phone
Preview
Form value: -
Display: -
Details
- Pattern:
{+}9999999[99999999] · +90 → {+}99 (999) 999 99 99 - Preset:
"phone" - Form value:
"+905551234567" - Error keys:
phone.incomplete - There is no per-country format table; other countries are shown without grouping. A leading 00 is dropped.
Customization
Turkey
country: "TR" gives (555) 123 45 67. Users can start with +90, 0 or the number itself; all give the same result. The form value has 10 digits.
Form value: -
Display: -
Send the masked value
Some backends want the masked text; output: "masked" writes the display text into the form.
useViraMask(form, {
phone: { preset: "phone", country: "TR", output: "masked" },
})
// form.watch("phone") → "(555) 123 45 67"For the hook API see useViraMask(); for your own pattern see custom mask.