ValidatedPhoneInput
v1.0.17Updated 19 Oct 2026Masked phone input with country-specific completeness validation across 12 countries (TH/US/UK/SG/AU/JP/KR/CN/PH/MY/ID/VN). Searchable country picker on the left, masked local number on the right (react-imask), plus E.16
Preview
Live · 11 stories▸Why this is recommendedformphonevalidationmask+4
ValidatedPhoneInput — thai by default.
- ✓International signups
- ✓KYC / contact capture
- ✓SMS-verification flows
- ✓Shipping-address phone field
- Country-specific digit-length + mask validation (12 countries)
- Searchable country picker (name / ISO / dial code)
- react-imask masked entry
- E.164 normalisation via toE164() helper
- showE164Format renders normalised number below
- Lockable to a single country (showCountryPicker=false)
- Server-error injection
- i18n: labels prop + country names localized via Intl.DisplayNames (LocaleProvider locale)
- ✕Free-text input (use Input)
- ✕Display-only formatting (use InputMask)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
valueRaw local-number value
—onValueChangeValue callback
—countryActive ISO country
—onCountryChangeCountry callback
—availableCountriesRestrict picker list
—showCountryPickerShow the leading picker (default true)
—showE164FormatShow normalised E.164 below
—validateOnValidation timing
—serverErrorForced server-side error
—labelsOverride built-in UI strings (i18n)
—aria-invalidMark the field invalid from outside; the box paints the same destructive state as its own validation, with the alert in its own trailing slot (FormField clones this in from its error prop)
—aria-describedbyId(s) of outside hint or error text, kept alongside the messages the field owns (FormField clones this in)
—aria-requiredMark the input required for assistive tech (FormField clones this in from its required prop)
—aria-labelAccessible name where the layout has no room for a visible `label` — a filter row, a subscribe box beside its button. Prefer `label`: a visible one names the field for everybody. These components destructure a fixed prop set and used to DROP an aria-label a caller wrote, so such a field announced as nothing but its role.
—