Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
mgr-form-react
Advanced tools
Readme
Current package is under development and has the same name. It has breaking changes (basically it is rewritten from scratch, so nothing left from old version).
mgr-form-react
allows you to create complicated forms based on JSON description.
The form description can be provided via network and so be stored on a server, be loaded from client side and even be shared between clients.
Rendering of form's inputs is done by "renderes". mgr-form-react
provides you some default renderers such as input
, select
, checkbox
etc. but you can define and register your own renderers during the application runtime. In the same way you can add validations and transformations to your fields by registering them and using in the field description. Also, you can define disable
and hide
functions on a field level that will define when the field should be disabled or hidden.
The submission part of the form is rendered in the same way that form's fields. You can use the default renderer for the submission (showing just a button) or create your custom submission renderer.
To know more about capabilities of mgr-form-react
please refer to the documentation.
import Form from 'mgr-form-react';
const description = {
fields: [{
name: 'username',
renderer: 'input',
validators: 'required',
transformations: 'trim',
placeholder: 'Username'
}, {
name: 'email',
renderer: 'input',
validators: ['required', 'email'],
transformations: 'trim',
placeholder: 'email',
}, {
name: 'age',
label: 'Your age',
renderer: 'selector',
defaultValue: 1,
options: [{
label: '0-18',
value: 0,
}, {
label: '19-45',
value: 1,
}, {
label: '46-100',
value: 2,
}],
}],
submission: {
renderer: 'button',
label: 'Submit your data',
},
};
export default () => (
<Form description={description} />
);
To see more examples, please refer to the documentation.
This package exports a <Form />
component by default and some usefull functions:
FAQs
Simple react form component. Generates a form based on json description
The npm package mgr-form-react receives a total of 6 weekly downloads. As such, mgr-form-react popularity was classified as not popular.
We found that mgr-form-react 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.