# ice-dynamic-form

> ICE 动态表单组件

Latest version **0.1.0** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ice-dynamic-form
pnpm add ice-dynamic-form
yarn add ice-dynamic-form
bun add ice-dynamic-form
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-08-21 |
| First published | 2019-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 854.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jincdream |
| Keywords | ice, react, component |

## Links

- npm: https://www.npmjs.com/package/ice-dynamic-form
- Homepage: https://unpkg.com/ice-dynamic-form@0.1.0/build/index.html
- npm.io page: https://npm.io/package/ice-dynamic-form

## Dependencies (2)

- [@ice/form](https://npm.io/package/@ice/form.md) ^0.1.1
- [classnames](https://npm.io/package/classnames.md) ^2.2.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-08-21

## README

## 背景

基于``ice/form``实现的动态表单组件。

## 特性

- 内部几乎无依赖，体积小
- 强大的校验以及声明式联动
- 可结合第三方组件库(Next、Antd)
- 可自定义表单组件


## 安装

```bash
$ npm i ice-dynamic-form --save
```

## 快速上手

下面例子演示了如何创建一个简单的 form：

````jsx
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import FormDynamic from 'ice-dynamic-form';
import { Button, Input } from '@alifd/next';

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))

class App extends Component {
  async onSubmit(values) {
    await sleep(300)
    window.alert(JSON.stringify(values, 0, 2))
  }

  render() {
    return (
      <div>
        <h2>个人资料</h2>
        <FormDynamic
          onSubmit={this.onSubmit}
          components={{
            Input,
            TextArea: Input.TextArea,
            Button
          }}
          config={[{
            name: 'username',
            type: 'Input',
            label: '姓名：',
          },{
            name: 'age',
            type: 'Input',
            label: '年龄：',
          },{
            name: 'intro',
            type: 'TextArea',
            label: '简介：',
          }]}
          buttons={[{
            name: 'submit',
            type: 'Button',
            text: 'Submit',
            props: {
              htmlType: 'submit'
            }
          }]}
        />
      </div>
    );
  }
}

ReactDOM.render((
  <App />
), mountNode);
````

---
_Source: https://npm.io/package/ice-dynamic-form · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
