mr8bit / antd-country-phone-input

Country phone input component as standard Ant.Design form item

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

antd-country-phone-input

Country phone input component as standard Ant.Design form item.

Currently only support Chinese.

Preview

Installation

npm i antd-country-phone-input

Usage

Edit antd-country-phone-input

import { Button, Form } from 'antd';
import CountryPhoneInput from "antd-country-phone-input";

const App = () => {
  const onFinish = (values) => {
    console.log('Success:', values);
  };

  const onFinishFailed = (errorInfo) => {
    console.log('Failed:', errorInfo);
  };

  return (
    <Form
      onFinish={onFinish}
      onFinishFailed={onFinishFailed}
      style={{ width: 400, height: 300, margin: 40 }}
    >
      <Form.Item name="phone">
        <CountryPhoneInput />
      </Form.Item>
      <Form.Item>
        <Button type="primary" htmlType="submit">
          Submit
        </Button>
      </Form.Item>
    </Form>
  );
};

export default App;

About

Country phone input component as standard Ant.Design form item


Languages

Language:TypeScript 92.1%Language:HTML 5.3%Language:JavaScript 1.4%Language:CSS 1.2%