formsy-antd
This library is a wrapper for ant-design form components to allow them to be used with formsy-react.
Installation
To add formsy-antd to you package.json and install it, run:
$ npm i formsy-antd
You will also need to add formsy-react if not already installed:
$ npm i formsy-react
Usage
; { return <Form onSubmit=> <FormItem required=true label="Username"> <Input name="name" value="wmzy" validations="minLength:4" validationError="minLength:4" /> </FormItem> <button type="submit">submit</button> </Form> ;}
And import stylesheets manually:
; // or 'antd/dist/antd.less'
Use modularized formsy-antd
babel-plugin-import (Recommended)
Use// .babelrc or babel-loader option "plugins": "import" "libraryName": "formsy-antd" "style": "css" // `style: true` for less
This allows you to import components from antd without having to manually import the corresponding stylesheet. The antd-babel-plugin will automatically import stylesheets.
// import js and css modularly, parsed by babel-plugin-import;
Manually import
; // for js; // for css// import 'antd/lib/date-picker/style'; // that will import less
See also: http://ant.design/docs/react/introduce
Wrap Customized Form Controls
There are some functions help you to wrap customized form controls.
;; '';
Examples
See storybook.