React Form Hook for Ant Design — open-source library by RaftLabs

Ant Design forms. React Form Hook. No Controller boilerplate.

An open-source TypeScript library built at RaftLabs that wires Ant Design's form components to React Hook Form — so you pass your useForm() hook once and every field connects automatically.

Components

What is in the package

Sixteen field components covering inputs, selects, date pickers, file uploads, rich text, and timezone selection — plus MainForm, the shell that connects everything to your useForm() hook.

  • 01

    InputField, InputPasswordField, InputTextAreaField

    Standard text inputs wired to RHF — text, password, and multiline textarea variants. Error state and helper text handled automatically from the form hook.

  • 02

    InputNumberField

    AntD's numeric input connected to RHF. Useful for quantities, prices, and other numeric fields where browser inputs fall short.

  • 03

    SelectField and AutoCompleteField

    Dropdown and autocomplete inputs that accept an options array of label/value pairs. Both forward AntD's full API via formItemProps.

  • 04

    DatePickerField and RangePickerField

    Single-date and date-range pickers from AntD's calendar. RHF handles the value lifecycle so you don't manage date state separately.

  • 05

    CheckboxField, RadioGroupField, SwitchField

    Boolean and selection controls. RadioGroupField accepts the same options array as SelectField. All three surface RHF validation errors without extra wiring.

  • 06

    ImageUploadField and CSVUploadField

    File upload fields with configurable button labels. Image and CSV variants cover the two most common data ingestion patterns in internal tools.

  • 07

    RichTextEditorField

    Embedded rich text editor that writes its output into RHF form state. Useful when forms need formatted content rather than plain strings.

  • 08

    TimezonePicker

    Timezone selector backed by a searchable dropdown. Covers the edge case that plain SelectField cannot — timezone lists are long and need fast filtering.

  • 09

    MainForm

    The form shell. Pass your useForm() hook and an onSubmit handler. It handles AntD's Form context and RHF's handleSubmit in one wrapper so field components can connect without manual context threading.

Archived — not actively maintained

RaftLabs moved from Ant Design to ShadCN. This library is published as-is and will not receive updates. The source is open if you want to fork it or read the pattern.

Questions about React Form Hook for Ant Design

Ant Design has strong form components. React Hook Form is the most performant form library for React. Wiring the two together requires a Controller wrapper for every field. Across a large internal tools project, that boilerplate adds up. We extracted the pattern into a shared library so it only had to be written once.
No. RaftLabs migrated from Ant Design to ShadCN. The library is archived and published as-is. It works with the AntD and RHF versions it was built against, but will not receive updates.
You can, but we would not recommend it for greenfield work. The library targets an older AntD version and is not tested against current releases. If you are starting fresh with AntD and RHF, writing your own Controller wrappers gives you full control and keeps your dependency tree clean.
ShadCN's component primitives, combined with React Hook Form directly. ShadCN components are designed to be copied into your codebase rather than imported as a dependency — which means no wrapper library is needed at all.

Building with React?

Tell us what you are building. We will tell you how we would approach it.

Tell us what's not working in your business. We'll find the real problem and tell you exactly what it would take to fix it.

  • Scope and cost agreed before work starts. No surprises. No obligation.
  • Working prototype within 3 weeks of kickoff.
  • Pay by milestone. You see progress before each invoice.
  • 60-day post-launch warranty. Bug fixes, UI tweaks, and deployment support. No retainer.
  • All conversations are NDA-protected.