You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ The value of the component is an object containing the parts of the phone number
31
31
32
32
## Validation
33
33
34
-
The validation is checked by the `valid` function of the value object that returns a boolean value. An example with the [react-hook-form](https://www.npmjs.com/package/react-hook-form) is shown below:
34
+
The validation is checked by the `valid` function of the value object that returns a boolean value. An example with the [react-hook-form](https://www.npmjs.com/package/react-hook-form) is shown [here](https://github.com/typesnippet/antd-phone-input/issues/64#issuecomment-1855867861).
35
35
36
36
```javascript
37
37
importReactfrom"react";
@@ -75,22 +75,23 @@ NOTE: If you use localization in the [documented](https://ant.design/docs/react/
75
75
76
76
Apart from the phone-specific properties described below, all [Input](https://ant.design/components/input#input) properties supported by the used Ant Design version can be applied to the phone input component.
| value | An object containing a parsed phone number or the raw number. This also applies to the `initialValue` property of [Form.Item](https://ant.design/components/form#formitem). | [object](#value) / string |
81
-
| country | Country code to be selected by default. By default, it will show the flag of the user's country. | string |
82
-
| enableArrow | Shows an arrow next to the country flag. Default value is `false`. | boolean |
83
-
| enableSearch | Enables search in the country selection dropdown menu. Default value is `false`. | boolean |
84
-
| searchNotFound | The value is shown if `enableSearch` is `true` and the query does not match any country. Default value is `No country found`. | string |
85
-
| searchPlaceholder | The value is shown if `enableSearch` is `true`. Default value is `Search country`. | string |
86
-
| disableDropdown | Disables the manual country selection through the dropdown menu. | boolean |
87
-
| disableParentheses | Disables parentheses from the input masks. Default enabled. | boolean |
88
-
| onlyCountries | Country codes to be included in the list. E.g. `onlyCountries={['us', 'ca', 'uk']}`. | string[] |
89
-
| excludeCountries | Country codes to be excluded from the list of countries. E.g. `excludeCountries={['us', 'ca', 'uk']}`. | string[] |
90
-
| preferredCountries | Country codes to be at the top of the list. E.g. `preferredCountries={['us', 'ca', 'uk']}`. | string[] |
91
-
| dropdownRender | Customize the dropdown menu content. | (menu: ReactNode) => ReactNode |
92
-
| onChange | The only difference from the original `onChange` is that value comes first. | function(value, event) |
93
-
| onMount | The callback is triggered once the component gets mounted. | function(value) |
| value | An object containing a parsed phone number or the raw number. This also applies to the `initialValue` property of [Form.Item](https://ant.design/components/form#formitem). | [object](#value) / string |
81
+
| country | Country code to be selected by default. By default, it will show the flag of the user's country. | string |
82
+
| distinct | Show the distinct list of country codes not listing all area codes. | boolean |
83
+
| enableArrow | Shows an arrow next to the country flag. Default value is `false`. | boolean |
84
+
| enableSearch | Enables search in the country selection dropdown menu. Default value is `false`. | boolean |
85
+
| searchNotFound | The value is shown if `enableSearch` is `true` and the query does not match any country. Default value is `No country found`. | string |
86
+
| searchPlaceholder | The value is shown if `enableSearch` is `true`. Default value is `Search country`. | string |
87
+
| disableDropdown | Disables the manual country selection through the dropdown menu. | boolean |
88
+
| disableParentheses | Disables parentheses from the input masks. Default enabled. | boolean |
89
+
| onlyCountries | Country codes to be included in the list. E.g. `onlyCountries={['us', 'ca', 'uk']}`. | string[] |
90
+
| excludeCountries | Country codes to be excluded from the list of countries. E.g. `excludeCountries={['us', 'ca', 'uk']}`. | string[] |
91
+
| preferredCountries | Country codes to be at the top of the list. E.g. `preferredCountries={['us', 'ca', 'uk']}`. | string[] |
92
+
| dropdownRender | Customize the dropdown menu content. | (menu: ReactNode) => ReactNode |
93
+
| onChange | The only difference from the original `onChange` is that value comes first. | function(value, event) |
94
+
| onMount | The callback is triggered once the component gets mounted. | function(value) |
0 commit comments