# mdl-form

> Form for Material Design Lite

Latest version **1.0.7** (published 2016-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install mdl-form
pnpm add mdl-form
yarn add mdl-form
bun add mdl-form
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2016-03-17 |
| First published | 2016-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | HsuTing |
| Maintainers | hsuting |
| Keywords | Material, Design, Lite, Form, mdl-form |

## Links

- npm: https://www.npmjs.com/package/mdl-form
- Repository: https://github.com/HsuTing/mdl-form
- Homepage: https://github.com/HsuTing/mdl-form#readme
- Issues: https://github.com/HsuTing/mdl-form/issues
- npm.io page: https://npm.io/package/mdl-form

## 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

- 1.0.7 (latest) — 2016-03-17
- 1.0.6 — 2016-03-17
- 1.0.5 — 2016-03-17
- 1.0.4 — 2016-02-01
- 1.0.3 — 2016-01-30
- 1.0.2 — 2016-01-30
- 1.0.1 — 2016-01-30
- 1.0.0 — 2016-01-30

## README

# Form for Material Design Lite

## Start

- [Node.js](https://nodejs.org/en/) must be installed.
- Install package:
```
  npm install mdl-form jquery react 
```

## Example

You can see [here](https://github.com/HsuTing/mdl-form-example/tree/gh-pages).

- [code](https://github.com/HsuTing/mdl-form-example/blob/gh-pages/src/index.jsx)
- [website](http://hsuting.github.io/mdl-form-example/)

## List

- [mdl-form-input](https://github.com/HsuTing/mdl-form-input)
- [mdl-form-radio](https://github.com/HsuTing/mdl-form-radio)
- [mdl-form-textarea](https://github.com/HsuTing/mdl-form-textarea)
- [mdl-form-file](https://github.com/HsuTing/mdl-form-file)

## Render

- Give a `json` to `data`. The parameter is at [here](https://github.com/HsuTing/mdl-form#parameter).
- Give an object of components to `tags`.
  * `key` is also used in `tags` of `form`.
  * `value` is component.
  * If you do not set a default component, `form` will set first component to default component.

## Animation

- You can add an animation at render.
- `form-hide-animation` will hide form and rerender new form. `form-hide` will be added finally.
- `form-show-animation` will show form after form is updated. `form-show` will be added finally.
- noAnimation -> if you use `noAnimation={true}`, this form will not render with animation.

## Parameter

### Title

- label
- className
- style

### Submit

- label
- className
- style
- url
- click(function)
- success(function)
  * 1st argument -> get data from server.
- fail(function)
  * 1st argument -> data which you post to server.

### Form

- This is an object for your componets in `Form`.
- `id` is needed.
- isNotRequire -> if you use `isNotRequire: true`, this component can be empty to post to server. 

## How to write component

- You can see [list](https://github.com/HsuTing/mdl-form#list).
- Props have three function and one data
  * keyDown(function) -> this will call a click on `submit`.
  * getData(function) -> give data to `form`.
    + 1st argument -> `id` of this component, use `this.props.data.id`, normal.
    + 2nd argument -> give this component data to `form`.
    + You should call it in render function and set data to empty.
    + Example: this.props.getData(this.props.data.id, '')
  * getComponents(function) -> give this component to `form`.
    + 1st argument -> id` of this component, use `this.props.data.id`, normal.
    + 2nd argument -> this component.
    + You should call it in render function.
    + Example: this.props.getComponent(this.props.data.id, this).
  * data -> all information about component is in `this.props.data`.

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