Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Formst is a JS library for quickly building high-performance forms in React. Unlike most form libraries that are UI-First, Formst is Data-First.
Formst is a JS library for quickly building high-performance forms in React. Unlike most form libraries that are UI-First, Formst is Data-First.
While working on a recent project, GeekyAnts devs realised that there was no easy way to build forms for React apps. Yes, there are solutions available but they're not quite optimal. It is difficult to find a single library that provides great UX, speed and features such as interdependency between form fields. That's when we decided to build Formst, a library that allows you to build high-performance, responsive forms for your React apps.
Use 'yarn' or 'npm' to install this library as shown below:
# yarn
yarn add mst-form-creator
# npm
npm add mst-form-creator
Create a form model as shown below:
const TodoForm = createFormModel(
'TodoForm',
{
title: types.string,
description: types.string,
},
{
validation: {
title: ['required'],
description: 'required',
},
}
);
Create an instance of the model:
const todoForm = TodoForm.create({
title: '',
description: '',
});
Add handler for submit
todoForm.onSubmit((formInstance: Instance<typeof createProjectForm>) => {
console.log(formInstance.getFormData());
formInstance.setSubmitting(false);
});
Wrap the components inside MSTForm and use the Field API to render the fields:
<MSTForm formInstance={todoForm}>
<form onSubmit={todoForm.handleSubmit}>
<Field name="title" />
<ErrorMessage name="title" />
<br />
<Field name="description" />
<ErrorMessage name="description" />
<button type="submit">Submit</button>
</form>
</MSTForm>
Thank you for your interest in contributing to Formst! We are lucky to have you 🙂 Head over to Contribution Guidelines and learn how you can be a part of a wonderful, growing community.
For major changes, please open an issue first to discuss changes and update tests as appropriate.
Licensed under the MIT License, Copyright © 2020 GeekyAnts. See LICENSE for more information.
FAQs
Formst is a JS library for quickly building high-performance forms in React. Unlike most form libraries that are UI-First, Formst is Data-First.
We found that formst demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.