form4antdesign
v1.0.14
Published
A module for form validation for Ant Design, building forms in React applications. It provides hooks to manage form state, validation, and submission efficiently, with minimal re-renders. It helps you easily handle form inputs, validation rules, and error
Maintainers
Readme
FormForAntDesign
A set of React components for building forms with Ant Design and react-hook-form. This library helps you manage form state, validation, and submission efficiently, with minimal re-renders.
Features
- Integrates Ant Design UI with react-hook-form
- Easy form state management and validation
- Custom components: TextField, Switch, Select, MultiCheckbox, RadioGroup, and Provider
Installation
npm install form4antdesignCompatible Versions
- React: ^18.0.0
- Ant Design: ^5.0.0
- React Hook Form: ^7.0.0
Usage
// JSX Form
import { FormProvider, FormTextField, FormSwitch, FormSelect, FormMultiCheckbox, FormRadioGroup } from "form4antdesign";
const functionName = (params) => {
return (
<FormProvider {...methods}>
{/* <FormSwitch, FormSelect, FormMultiCheckbox, FormRadioGroup />... */}
<FormTextField name="example" />
</FormProvider>
);
};Components
FormProvider: Wraps your form and provides react-hook-form context.FormTextField: Ant Design input integrated with react-hook-form.FormSwitch: Ant Design switch integrated with react-hook-form.FormSelect: Ant Design select integrated with react-hook-form.FormMultiCheckbox: Ant Design checkbox group integrated with react-hook-form.FormRadioGroup: Ant Design radio group integrated with react-hook-form.
License
ISC
Author
Nguyhizthatgud "# form4antdesign" "# form4antdesign"
