antd-country-phone-input
Country phone input component as standard Ant.Design form item.
Installation
npm install antd-country-phone-input
or
yarn add antd-country-phone-input
Usage
Breaking Changes: For better performance and avoid unnecessary encapsulation, locale
and area customization APIs are moved to ConfigProvider
(based on React Context).
import CountryPhoneInput, { ConfigProvider } from 'antd-country-phone-input';
import 'antd/dist/antd.css';
import 'antd-country-phone-input/dist/index.css';
const App = () => {
return (
<ConfigProvider locale="zh">
<CountryPhoneInput />
</ConfigProvider>
);
};
export default App;
Value
Field | Type | Note |
---|
short | string | See ISO 3166-1 |
phoneCode | number | |
emoji | ReactNode | National flag |
name | string | |
Supported Languages
Please check the typescript definition in source codes.