Skip to content

Commit a605df1

Browse files
committed
chore: merge agent branch with modernized README
2 parents dbe2181 + 241fc3c commit a605df1

1 file changed

Lines changed: 77 additions & 117 deletions

File tree

‎README.md‎

Lines changed: 77 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,49 @@
1-
### [Documentation](https://foxhound87.github.io/mobx-formkit) • [Live Demo](https://foxhound87.github.io/mobx-formkit-demo) • [Demo Code](https://github.com/foxhound87/mobx-formkit-demo) • [NPM](https://www.npmjs.com/package/mobx-formkit) • [Skills](https://github.com/foxhound87/skills) • [Tutorial](https://medium.com/@foxhound87/automagically-manage-react-forms-state-with-mobx-and-automatic-validation-2b00a32b9769) • [Join Discord Channel](https://discord.gg/CVV8w4zat4)
2-
31
# MobX Formkit
42

5-
### Reactive MobX Form State Management
6-
7-
[![NPM](https://nodei.co/npm/mobx-formkit.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/mobx-formkit)
8-
[![NPM Version](https://img.shields.io/npm/v/mobx-formkit?label=npm&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/mobx-formkit)
9-
10-
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/foxhound87/mobx-formkit/ci.yml?branch=master)
11-
![GitHub release (latest by date)](https://img.shields.io/github/v/release/foxhound87/mobx-formkit)
12-
![npm bundle size](https://img.shields.io/bundlephobia/min/mobx-formkit)
13-
![npm bundle size (gzip)](https://img.shields.io/bundlephobia/minzip/mobx-formkit)
14-
[![Codecov Coverage](https://img.shields.io/codecov/c/github/foxhound87/mobx-formkit/master.svg)](https://codecov.io/gh/foxhound87/mobx-formkit)
15-
[![node](https://img.shields.io/node/v/mobx-formkit.svg)]()
16-
[![GitHub license](https://img.shields.io/github/license/foxhound87/mobx-formkit.svg)]()
17-
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/foxhound87/mobx-formkit)
18-
![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/foxhound87/mobx-formkit)
19-
[![Downloads](https://img.shields.io/npm/dt/mobx-formkit.svg)]()
20-
[![Downloads](https://img.shields.io/npm/dm/mobx-formkit.svg)]()
21-
[![Backers on Open Collective](https://opencollective.com/mobx-react-form/backers/badge.svg)](#backers)
22-
[![Sponsors on Open Collective](https://opencollective.com/mobx-react-form/sponsors/badge.svg)](#sponsors)
3+
**Reactive MobX Form State Management** — extensible validation, nested fields, event hooks, and bindings for any UI framework, with full TypeScript support.
234

24-
<br>
5+
[Documentation](https://foxhound87.github.io/mobx-formkit/) &bull; [Quick Start](https://foxhound87.github.io/mobx-formkit/quick-start) &bull; [Live Demo](https://foxhound87.github.io/mobx-formkit-demo) &bull; [Demo Code](https://github.com/foxhound87/mobx-formkit-demo) &bull; [NPM](https://www.npmjs.com/package/mobx-formkit) &bull; [AI Skills](https://github.com/foxhound87/skills) &bull; [Discord](https://discord.gg/CVV8w4zat4)
256

26-
## Migrating from mobx-react-form
7+
[![npm version](https://img.shields.io/npm/v/mobx-formkit?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/mobx-formkit)
8+
[![npm downloads](https://img.shields.io/npm/dm/mobx-formkit?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/mobx-formkit)
9+
[![license](https://img.shields.io/github/license/foxhound87/mobx-formkit?style=for-the-badge)](https://github.com/foxhound87/mobx-formkit/blob/master/LICENSE)
10+
[![bundle size](https://img.shields.io/badge/bundle%20size-~8%20kB%20gzip-e11d48?style=for-the-badge)](https://foxhound87.github.io/mobx-formkit/performance-ssr)
11+
[![documentation](https://img.shields.io/badge/docs-mobx--formkit-e11d48?style=for-the-badge)](https://foxhound87.github.io/mobx-formkit/)
2712

28-
| What | Old | New |
29-
| -------------------- | ---------------------------- | ---------------------------- |
30-
| npm package | `mobx-react-form` | `mobx-formkit` |
31-
| UMD globals | `MobxReactForm*` | `MobxFormkit*` |
32-
| imports & everywhere | `mobx-react-form` | `mobx-formkit` |
13+
MobX Formkit is a form state management library built on MobX observables. The core is UI-agnostic — it depends only on `mobx` and renders in React, Vue 3, Lit, Angular, Solid, or vanilla JS through the matching MobX binding. Define your fields declaratively and get reactivity, validation, change tracking, and component bindings automatically.
3314

34-
> **Breaking (UMD):** UMD bundle filenames and script-tag globals changed from
35-
> `MobxReactForm*` to `MobxFormkit*` — update `<script src>` paths and global
36-
> references accordingly. There is no alias; APIs are otherwise identical.
15+
Read the [full documentation](https://foxhound87.github.io/mobx-formkit/) or jump straight to the [Quick Start](https://foxhound87.github.io/mobx-formkit/quick-start).
3716

3817
## Features
3918

40-
- Extensibles [Validation Plugins](https://foxhound87.github.io/mobx-formkit/validation/plugins.html).
41-
- Sync & Async Validation (w/ Promises & automatic errors).
42-
- Nested Fields (w/ Serialization & Validation).
43-
- Nested Forms (w/ Nested Submission & Validation Hooks).
44-
- [Event Hooks](https://foxhound87.github.io/mobx-formkit/events/event-hooks.html), [Event Handlers](https://foxhound87.github.io/mobx-formkit/events/event-handlers.html) & [Validation Hooks](https://foxhound87.github.io/mobx-formkit/events/validation-hooks.html)
45-
- Functional [Computed Field Props](https://foxhound87.github.io/mobx-formkit/extra/computed-props.html)
46-
- Field Props [Observers & Interceptors](https://foxhound87.github.io/mobx-formkit/extra/mobx-events.html)
47-
- Field [Props Bindings](https://foxhound87.github.io/mobx-formkit/bindings/README.html) for custom Components.
48-
- Support for Material UI, Ant Design, React Widgets, React Select, React Aria, Headless UI & more.
49-
- [AI Agent Skills](https://github.com/foxhound87/skills): installable guides for AI coding assistants
50-
- [Forms Composer](https://foxhound87.github.io/mobx-formkit/extra/composer.html): to handle multi-forms submit, validations and other actions
51-
- Dedicated [DevTools](https://github.com/foxhound87/mobx-react-form-devtools) Package.
52-
53-
<br>
54-
55-
## Quick Start
56-
57-
[![Edit form-quickstart](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/nrrZgG8y4)
19+
- **8 Validation Plugins** — [DVR, VJF, AJV, YUP, JOI, ZOD, VALIBOT & VINEJS](https://foxhound87.github.io/mobx-formkit/validation/plugins): sync & async, extendable, and mixable on the same form.
20+
- **Nested Fields & Arrays** — deeply nested [field structures](https://foxhound87.github.io/mobx-formkit/fields/) with dot notation, dynamic add/remove/move, ordered `ArrayMap` collections, and full serialization.
21+
- **Event Hooks & Handlers** — full lifecycle control: `onInit`, `onChange`, `onFocus`, `onBlur`, `onSubmit`, `onSuccess`, `onError` & [more](https://foxhound87.github.io/mobx-formkit/events/).
22+
- **UI-Agnostic Core** — the same `Form` instance renders in [React, Vue 3, Lit, Angular, Solid, Octane, or vanilla JS](https://foxhound87.github.io/mobx-formkit/frameworks) with a MobX binding.
23+
- **Field Props Bindings** — one-line [`bind()`](https://foxhound87.github.io/mobx-formkit/bindings/) for standard inputs, plus custom rewriters & templates for Material UI, Ant Design, React Aria, Headless UI, React Widgets, React Select, Chakra UI, PrimeReact & more.
24+
- **TypeScript First** — generics (`Form<F>`), typed field access, and [autocomplete for nested field paths](https://foxhound87.github.io/mobx-formkit/typescript).
25+
- **Reactive Computed Props** — [functional field props](https://foxhound87.github.io/mobx-formkit/extra/computed-props) that re-evaluate automatically when their MobX dependencies change.
26+
- **Forms Composer** — [orchestrate multiple forms](https://foxhound87.github.io/mobx-formkit/extra/composer) for wizards and multi-step flows with batch validate/submit/clear.
27+
- **Tiny & SSR-Ready** — ~8 kB gzip, tree-shakeable, zero DOM dependencies; works with Next.js, Remix, Vite & any [SSR setup](https://foxhound87.github.io/mobx-formkit/performance-ssr).
28+
- **MobX 5, 6 & 7** — one peer dependency range: `^5.15.0 || ^6.0.0 || ^7.0.0`.
29+
- **DevTools** — a dedicated [DevTools package & browser extension](https://foxhound87.github.io/mobx-formkit/devtools) to inspect form state, fields, and validation in real time.
30+
- **AI Agent Skills** — installable [skill files](https://foxhound87.github.io/mobx-formkit/skills) for Cursor, Windsurf, Claude Code, Codebuff & Copilot.
31+
32+
## Quick Example
5833

5934
```bash
6035
npm install --save mobx-formkit
6136
```
6237

63-
> **MobX 6 & 7 support**: `mobx-formkit` works with both `mobx@6` and `mobx@7` (peer dependency: `^6.0.0 || ^7.0.0`). For MobX 7 use the matching React bindings (`mobx-react@^10`).
64-
65-
#### Choose and Setup a Validation Plugin
66-
67-
Below we are creating a `plugins` object using the `validatorjs` package to enable `DVR` functionalities (Declarative Validation Rules).
68-
6938
```javascript
39+
import { Form } from "mobx-formkit";
7040
import dvr from "mobx-formkit/lib/validators/DVR";
7141
import validatorjs from "validatorjs";
7242

7343
const plugins = {
74-
dvr: dvr({
75-
package: validatorjs,
76-
}),
44+
dvr: dvr({ package: validatorjs }),
7745
};
78-
```
79-
80-
> See [Validation Plugins](https://foxhound87.github.io/mobx-formkit/validation/plugins.html) for more info on supported packages.
8146

82-
#### Define the Form Fields
83-
84-
Define the `fields` as a collection with a `rules` property for the validation.
85-
86-
```javascript
8747
const fields = [
8848
{
8949
name: "email",
@@ -106,81 +66,76 @@ const fields = [
10666
type: "password",
10767
},
10868
];
109-
```
110-
111-
> See [Fields Definitions](https://foxhound87.github.io/mobx-formkit/fields/) and all available [Field Props](https://foxhound87.github.io/mobx-formkit/api-reference/fields-properties.html) on the docs.
11269

113-
#### Define the Validation Hooks
114-
115-
```javascript
11670
const hooks = {
11771
onSuccess(form) {
11872
alert("Form is valid! Send the request here.");
119-
// get field values
120-
console.log("Form Values!", form.values());
12173
},
12274
onError(form) {
12375
alert("Form has errors!");
124-
// get all form errors
125-
console.log("All form errors", form.errors());
12676
},
12777
};
128-
```
129-
130-
> See more on the docs about the [Validation Hooks](https://foxhound87.github.io/mobx-formkit/events/validation-hooks.html) and the [Event Hooks](https://foxhound87.github.io/mobx-formkit/events/event-hooks.html)
131-
132-
#### Initialize the Form
13378

134-
Simply pass the `fields`, `plugins` and `hooks` objects to the constructor
135-
136-
```javascript
137-
import MobxFormkit from "mobx-formkit";
138-
139-
const myForm = new MobxFormkit({ fields }, { plugins, hooks });
79+
const form = new Form({ fields }, { plugins, hooks });
14080
```
14181

142-
> Learn more on the docs about the [Form Instance](https://foxhound87.github.io/mobx-formkit/form/) and the [Form Options](https://foxhound87.github.io/mobx-formkit/form/form-options.html)
143-
144-
#### Pass the myForm to a react component
145-
146-
The package provide some built-in and ready to use Event Handlers:
147-
148-
`onSubmit(e)`, `onClear(e)`, `onReset(e)` & [more...](https://foxhound87.github.io/mobx-formkit/events/event-handlers.html)
149-
150-
```javascript
82+
```jsx
15183
import React from "react";
15284
import { observer } from "mobx-react";
15385

154-
export default observer(({ myForm }) => (
155-
<form onSubmit={myForm.onSubmit}>
156-
<label htmlFor={myForm.$("email").id}>{myForm.$("email").label}</label>
157-
<input {...myForm.$("email").bind()} />
158-
<p>{myForm.$("email").error}</p>
159-
160-
{/* ... other inputs ... */}
86+
export default observer(({ form }) => (
87+
<form onSubmit={form.onSubmit}>
88+
<label htmlFor={form.$("email").id}>{form.$("email").label}</label>
89+
<input {...form.$("email").bind()} />
90+
<p>{form.$("email").error}</p>
16191

162-
<button type="submit" onClick={myForm.onSubmit}>
163-
Submit
164-
</button>
165-
<button type="button" onClick={myForm.onClear}>
92+
<button type="submit">Submit</button>
93+
<button type="button" onClick={form.onClear}>
16694
Clear
16795
</button>
168-
<button type="button" onClick={myForm.onReset}>
96+
<button type="button" onClick={form.onReset}>
16997
Reset
17098
</button>
17199

172-
<p>{myForm.error}</p>
100+
<p>{form.error}</p>
173101
</form>
174102
));
175103
```
176104

177-
> See more on the docs about the [Field Props Bindings](https://foxhound87.github.io/mobx-formkit/bindings)
105+
Follow the [full Quick Start guide](https://foxhound87.github.io/mobx-formkit/quick-start) or the [class-based setup](https://foxhound87.github.io/mobx-formkit/quick-start-class) for the complete walkthrough.
106+
107+
## Documentation
178108

179-
###### Extending the Form class
109+
| Topic | Links |
110+
| --- | --- |
111+
| **Getting Started** | [Quick Start](https://foxhound87.github.io/mobx-formkit/quick-start) &middot; [Class-based Setup](https://foxhound87.github.io/mobx-formkit/quick-start-class) &middot; [TypeScript](https://foxhound87.github.io/mobx-formkit/typescript) &middot; [UMD Setup](https://foxhound87.github.io/mobx-formkit/umd-setup) |
112+
| **Form & Fields** | [Form Instance](https://foxhound87.github.io/mobx-formkit/form/) &middot; [Form Options](https://foxhound87.github.io/mobx-formkit/form/form-options) &middot; [Defining Fields](https://foxhound87.github.io/mobx-formkit/fields/) |
113+
| **Actions** | [Form Actions](https://foxhound87.github.io/mobx-formkit/actions/form) &middot; [Get, Set & Update](https://foxhound87.github.io/mobx-formkit/actions/get-set) &middot; [Add, Delete & Move](https://foxhound87.github.io/mobx-formkit/actions/add-del) &middot; [Validation & Submit](https://foxhound87.github.io/mobx-formkit/actions/validate) |
114+
| **Validation** | [Choosing a Plugin](https://foxhound87.github.io/mobx-formkit/validation/) &middot; [Plugins & Packages](https://foxhound87.github.io/mobx-formkit/validation/plugins) &middot; [Validation Lifecycle](https://foxhound87.github.io/mobx-formkit/validation/lifecycle) |
115+
| **Events** | [Event Handlers](https://foxhound87.github.io/mobx-formkit/events/event-handlers) &middot; [Event Hooks](https://foxhound87.github.io/mobx-formkit/events/event-hooks) &middot; [Validation Hooks](https://foxhound87.github.io/mobx-formkit/events/validation-hooks) |
116+
| **Bindings** | [Default Bindings](https://foxhound87.github.io/mobx-formkit/bindings/default) &middot; [Custom Bindings](https://foxhound87.github.io/mobx-formkit/bindings/custom) |
117+
| **API Reference** | [Form Properties](https://foxhound87.github.io/mobx-formkit/api-reference/form-properties) &middot; [Form Methods](https://foxhound87.github.io/mobx-formkit/api-reference/form-methods) &middot; [Fields Properties](https://foxhound87.github.io/mobx-formkit/api-reference/fields-properties) &middot; [Fields Methods](https://foxhound87.github.io/mobx-formkit/api-reference/fields-methods) |
118+
| **Advanced** | [Overview](https://foxhound87.github.io/mobx-formkit/advanced/) &middot; [Wizard (multi-step)](https://foxhound87.github.io/mobx-formkit/advanced/wizard) &middot; [Sortable Lists](https://foxhound87.github.io/mobx-formkit/advanced/sortable) &middot; [File Upload](https://foxhound87.github.io/mobx-formkit/advanced/file-upload) |
119+
| **Extra** | [Computed Props](https://foxhound87.github.io/mobx-formkit/extra/computed-props) &middot; [Input & Output Converters](https://foxhound87.github.io/mobx-formkit/extra/converters) &middot; [Forms Composer](https://foxhound87.github.io/mobx-formkit/extra/composer) &middot; [Recipes & Patterns](https://foxhound87.github.io/mobx-formkit/recipes) &middot; [Troubleshooting & FAQ](https://foxhound87.github.io/mobx-formkit/troubleshooting) |
120+
| **Guides** | [Migration Guide](https://foxhound87.github.io/mobx-formkit/migration-guide) &middot; [Error Handling](https://foxhound87.github.io/mobx-formkit/error-handling) &middot; [Performance & SSR](https://foxhound87.github.io/mobx-formkit/performance-ssr) &middot; [Render Engine Support](https://foxhound87.github.io/mobx-formkit/frameworks) |
121+
| **Ecosystem** | [DevTools](https://foxhound87.github.io/mobx-formkit/devtools) &middot; [AI Agent Skills](https://foxhound87.github.io/mobx-formkit/skills) &middot; [Live Demo](https://foxhound87.github.io/mobx-formkit-demo) |
180122

181-
[See how to implement the same configuration of this quickstart extending the Form class](https://foxhound87.github.io/mobx-formkit/quick-start-class.html)
123+
## Legacy: mobx-react-form (MRF)
182124

183-
<br>
125+
MobX Formkit is the successor of [**mobx-react-form**](https://www.npmjs.com/package/mobx-react-form) (MRF). The legacy package has been **renamed and deprecated on npm** — the codebase and its API continue here. To migrate, swap the package and update your imports:
126+
127+
```bash
128+
npm uninstall mobx-react-form
129+
npm install --save mobx-formkit
130+
```
131+
132+
[![mobx-react-form version](https://img.shields.io/npm/v/mobx-react-form?style=for-the-badge&label=mobx-react-form&logo=npm)](https://www.npmjs.com/package/mobx-react-form)
133+
[![legacy weekly downloads](https://img.shields.io/npm/dw/mobx-react-form?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/mobx-react-form)
134+
[![legacy monthly downloads](https://img.shields.io/npm/dm/mobx-react-form?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/mobx-react-form)
135+
136+
As of August 2026, the final legacy release (`mobx-react-form@7.1.0`) still sees **~8.0k downloads/week**, **~47.4k downloads/month**, and **~664k downloads/year** (npm API). If you are still on MRF, this is the drop-in replacement.
137+
138+
See the [Migration Guide](https://foxhound87.github.io/mobx-formkit/migration-guide) on the docs for breaking changes across major versions.
184139

185140
## Contributing
186141

@@ -199,16 +154,21 @@ These issues, and the ones which provides also PR with failing tests will get hi
199154
### Contributors
200155

201156
This project exists thanks to all the people who contribute.
202-
<a href="graphs/contributors"><img src="https://opencollective.com/mobx-react-form/contributors.svg?width=890&button=false" /></a>
157+
158+
<a href="https://github.com/foxhound87/mobx-formkit/graphs/contributors"><img src="https://contrib.rocks/image?repo=foxhound87/mobx-formkit" /></a>
203159

204160
### Backers
205161

206-
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/mobx-react-form#backer)]
162+
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/mobx-formkit#backer)]
207163

208-
<a href="https://opencollective.com/mobx-react-form#backers" target="_blank"><img src="https://opencollective.com/mobx-react-form/backers.svg?width=890"></a>
164+
<a href="https://opencollective.com/mobx-formkit#backers" target="_blank"><img src="https://opencollective.com/mobx-formkit/backers.svg?width=890"></a>
209165

210166
### Sponsors
211167

212-
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/mobx-react-form#sponsor)]
168+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/mobx-formkit#sponsor)]
169+
170+
<a href="https://opencollective.com/mobx-formkit#sponsors" target="_blank"><img src="https://opencollective.com/mobx-formkit/sponsors.svg?width=890"></a>
171+
172+
## License
213173

214-
<img src="https://opencollective.com/mobx-react-form/sponsors.svg"/>
174+
[MIT](https://github.com/foxhound87/mobx-formkit/blob/master/LICENSE) &copy; [Claudio Savino](https://github.com/foxhound87)

0 commit comments

Comments
 (0)