
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
formsy-antd
Advanced tools
This library is a wrapper for ant-design form components to allow them to be used with formsy-react.
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
import {Form, FormItem, Input} from 'formsy-antd';
function MyForm() {
return (
<Form onSubmit={action('submit')}>
<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:
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
// .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
import { DatePicker } from 'formsy-antd';
import DatePicker from 'formsy-antd/lib/date-picker'; // for js
import 'antd/lib/date-picker/style/css'; // for css
// import 'antd/lib/date-picker/style'; // that will import less
See also: http://ant.design/docs/react/introduce
There are some functions help you to wrap customized form controls.
import Input from 'antd/lib/input';
import {mappingChangeEvent, formsyComponent} from 'formsy-antd/lib/util';
export default formsyComponent(mappingChangeEvent(Input, ev => ev.target.value), '');
See storybook.
FAQs
A formsy-react compatibility wrapper for antd form components.
The npm package formsy-antd receives a total of 1 weekly downloads. As such, formsy-antd popularity was classified as not popular.
We found that formsy-antd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.