@mgcrea/antd-hook-form

Provides a <Form /> component that enables you to use react-hook-form with AntDesign - Replaces the default AntDesign field-form form handling - Written from the ground up with TypeScript

Usage no npm install needed!

<script type="module">
  import mgcreaAntdHookForm from 'https://cdn.skypack.dev/@mgcrea/antd-hook-form';
</script>

README

antd-hook-form

npm version npm monthly downloads npm license github main workflow

Features

Docs

Install

npm install @mgcrea/antd-hook-form

Quickstart

import React from 'react';
import {Form, FormProps} from '@mgcrea/antd-hook-form';

function App() {
  const onSubmit = (data) => console.log(data);

  return (
    <Form labelCol={{span: 4}} wrapperCol={{span: 14}} layout="horizontal" onSubmit={onSubmit}>
      <Form.Item name="input1" label="Input">
        <Input />
      </Form.Item>
      <Form.Row wrapperCol={{span: 14, offset: 4}}>
        <Button htmlType="submit">Button</Button>
      </Form.Row>
    </Form>
  );
}