npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hero-u/form-antd

v1.0.0

Published

hero-u path based form bindings for Ant Design

Readme

@hero-u/form-antd

Ant Design bindings for @hero-u/form-core.

Installation

npm install @hero-u/form-antd @hero-u/form-core

Wrap your form in antd's <Form> to inherit its CSS variables:

import { Form } from 'antd';
import { FormProvider, Field } from '@hero-u/form-antd';
import { Input, Select } from 'antd';

<Form layout="horizontal">
  <FormProvider initialValues={{ name: '', role: 'admin' }}>
    <Field name="name" label="Name">
      <Input />
    </Field>
    <Field name="role" label="Role" width={80}>
      <Select options={[{ value: 'admin' }, { value: 'user' }]} />
    </Field>
  </FormProvider>
</Form>

<Field>

Renders a Form.Item layout wrapper and injects value / onChange / disabled into the child input via cloneElement.

<Field name="age" label="Age" validate={v => v < 0 ? 'Must be non-negative' : undefined}>
  <InputNumber />
</Field>

<Field name="active" label="Active" type="checkbox">
  <Checkbox />
</Field>

| Prop | Type | Description | |------|------|-------------| | name | Path \| PathSegment | Field path | | type | 'checkbox' | Use checked instead of value | | validate | FieldValidate | Field-level validator | | enableErrorWhenUntouched | boolean | Show error before the field is touched | | extraChildren | ReactNode | Rendered after the input inside Form.Item | | + all Form.Item props | | Except help, rules, shouldUpdate, dependencies |

<FieldLayout>

Form.Item wrapper used internally by <Field>. Use it directly when you need layout without a bound field path.

| Prop | Type | Default | Description | |------|------|---------|-------------| | width | number | 120 | Label column width in px | | hasGap | boolean | true | When false, sets marginBottom: 0 |

<FieldArray>

Manages a list of items with add/delete controls.

import { FieldArray } from '@hero-u/form-antd';

<FieldArray name="phones" createDefaultValue={() => ''} atLeastOne>
  {index => (
    <Field name={`phones.${index}`} label={`Phone ${index + 1}`} hasGap={false}>
      <Input />
    </Field>
  )}
</FieldArray>

| Prop | Type | Default | Description | |------|------|---------|-------------| | name | Path \| PathSegment | — | Array field path | | createDefaultValue | () => T | () => '' | Value for newly added items | | atLeastOne | boolean | false | Disable delete when only one item remains | | AddButton | ComponentType<AddButtonProps> | Button with PlusOutlined | Custom add trigger | | DeleteButton | ComponentType<DeleteButtonProps> | Button with DeleteOutlined | Custom delete trigger |

<FieldArrayTable> / <FieldArrayInnerTable>

Table-based array editor. Each row is a table row; columns are defined via createColumns.

import { FieldArrayTable } from '@hero-u/form-antd';

<FieldArrayTable
  name="items"
  createDefaultValue={() => ({ name: '', qty: 1 })}
  createColumns={({ DeleteButton }) => [
    {
      title: 'Name',
      render: (_, __, index) => (
        <Field name={`items.${index}.name`} hasGap={false}>
          <Input />
        </Field>
      ),
    },
    { title: '', render: (_, __, index) => <DeleteButton index={index} /> },
  ]}
/>

Re-exports

All of @hero-u/form-core is re-exported:

import { FormProvider, Field, useFieldValue, useFormContext, useFormSubmit } from '@hero-u/form-antd';

License

MIT