Demos
Live demo
Dynamic form
A quality form described in JSON and rendered by a recursive React component. Answer it and watch nested fields appear and the score change; then edit the JSON and the form updates without reloading.
Edit the form (JSON)
Changes apply as you type, as long as the JSON is valid. Field types: si-no (yes/no), seleccion (select), checkbox and texto (text). Try adding a fourth level inside "hijos".
Valid JSON: the form is up to date.
How it works
- 1The form is a JSON tree: each field has a type, the condition for showing its children, a weight and whether it is critical.
- 2A component registry maps each field type to its React component, replacing what Blade used to do on the server.
- 3A recursive component renders each field and, if the answer meets the condition, calls itself with the children: any depth with no code changes (the demo allows up to 5 levels).
- 4The score deducts failed regular items and drops to 0 if a critical item fails; hidden fields don't count. Zod validates the JSON before applying it.