@formhaus/react 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +29 -3
package/README.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
# @formhaus/react
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Navigation and submission
|
|
6
|
-
|
|
7
|
-
`FormRenderer` and `HeadlessFormRenderer` support radio `autoAdvance`, `next: false`, and async before/after navigation and submission hooks. React awaits `onSubmit` and keeps the form busy until it settles. Custom fields use `onCommit(value)` for activation; custom actions honor `showPrimary`. See [examples and lifecycle semantics](../../docs/guide/steps.md).
|
|
8
|
-
|
|
9
|
-
Step `routes` choose an ordered forward path from answers. Back, progress, validation and submission follow that path. See [branching and retained answers](../../docs/guide/steps.md#route-between-branches).
|
|
3
|
+
`@formhaus/react` renders a JSON form definition in React, including multi-step, conditional and branching forms. It uses native HTML inputs by default; pass your own components through the `components` prop. Part of [Formhaus](https://github.com/ignsm/formhaus).
|
|
10
4
|
|
|
11
5
|
## Install
|
|
12
6
|
|
|
@@ -16,10 +10,6 @@ npm install @formhaus/core @formhaus/react
|
|
|
16
10
|
|
|
17
11
|
Requires React ≥18 and Node ≥18.
|
|
18
12
|
|
|
19
|
-
## Generating a definition
|
|
20
|
-
|
|
21
|
-
Write the form JSON by hand, or use the [`/formhaus-create-form`](https://formhaus.dev/guide/formhaus-create-form.html) Claude Code skill to generate it from a text description, a CSV table, or a screenshot of an existing form.
|
|
22
|
-
|
|
23
13
|
## Usage
|
|
24
14
|
|
|
25
15
|
```tsx
|
|
@@ -38,6 +28,16 @@ export function ContactPage() {
|
|
|
38
28
|
}
|
|
39
29
|
```
|
|
40
30
|
|
|
31
|
+
## Generating a definition
|
|
32
|
+
|
|
33
|
+
Write the form JSON by hand, or use the [`/formhaus:formhaus-create-form`](https://formhaus.dev/guide/formhaus-create-form.html) Claude Code skill to generate it from a text description, a CSV table, or a screenshot of an existing form.
|
|
34
|
+
|
|
35
|
+
## Navigation and submission
|
|
36
|
+
|
|
37
|
+
`FormRenderer` and `HeadlessFormRenderer` support radio `autoAdvance`, `next: false`, and async before/after navigation and submission hooks. React awaits `onSubmit` and keeps the form busy until it settles. Custom fields use `onCommit(value)` for activation; custom actions honor `showPrimary`. See [examples and lifecycle semantics](https://formhaus.dev/guide/steps.html#lifecycle-hooks).
|
|
38
|
+
|
|
39
|
+
Step `routes` choose an ordered forward path from answers. Back, progress, validation and submission follow that path. See [branching and retained answers](https://formhaus.dev/guide/steps.html#route-between-branches).
|
|
40
|
+
|
|
41
41
|
## Custom components
|
|
42
42
|
|
|
43
43
|
Swap native HTML for your own UI kit:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formhaus/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Render multi-step, conditional and branching forms in React from a JSON form definition. Native inputs or your own components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"engines": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@formhaus/core": "0.
|
|
20
|
+
"@formhaus/core": "0.9.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=18.0.0"
|
|
@@ -34,11 +34,37 @@
|
|
|
34
34
|
"vitest": "^4.1.3"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
|
+
"homepage": "https://formhaus.dev",
|
|
37
38
|
"repository": {
|
|
38
39
|
"type": "git",
|
|
39
40
|
"url": "git+https://github.com/ignsm/formhaus.git",
|
|
40
41
|
"directory": "packages/react"
|
|
41
42
|
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/ignsm/formhaus/issues"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"form",
|
|
48
|
+
"forms",
|
|
49
|
+
"form-definition",
|
|
50
|
+
"json-form",
|
|
51
|
+
"form-renderer",
|
|
52
|
+
"multi-step-form",
|
|
53
|
+
"wizard",
|
|
54
|
+
"conditional-fields",
|
|
55
|
+
"conditional-logic",
|
|
56
|
+
"branching",
|
|
57
|
+
"validation",
|
|
58
|
+
"headless-form",
|
|
59
|
+
"form-engine",
|
|
60
|
+
"form-builder",
|
|
61
|
+
"survey",
|
|
62
|
+
"quiz",
|
|
63
|
+
"typescript",
|
|
64
|
+
"react",
|
|
65
|
+
"react-form",
|
|
66
|
+
"react-component"
|
|
67
|
+
],
|
|
42
68
|
"scripts": {
|
|
43
69
|
"build": "tsup",
|
|
44
70
|
"test": "vitest run",
|