UsePhoneInputOptions
type UsePhoneInputOptions = { customValidator?: (e164: string) => string | undefined; defaultCountry?: CountryCode; defaultValue?: string; isRequired?: boolean;};Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
customValidator? |
(e164: string) => string | undefined |
Extra rule on the E.164 value once it’s otherwise valid; return an error message to fail. Surfaces on blur/validate(). |
defaultCountry? |
CountryCode |
Initial country. Defaults to device locale, then the locale-prop region. |
defaultValue? |
string |
Initial display value. Defaults to the bare dial-code prefix. |
isRequired? |
boolean |
Whether the field is required. |