Skip to content

formio/ai / plugin/skills/formio-form

formio-form

Verified

Embed and render Form.io forms in any web app with the `@formio/js` renderer — by URL or JSON, pre-filled, controlled from JavaScript — and own field behavior: conditionals, calculated values, JSON Logic validation, cascading selects. The default "embed a form" entry point. Use when the user asks to "embed a form", "render a form", "add this form to my page", "pre-fill a form", "show or hide a field based on another field", "calculate a field value", "add custom validation to a field", or add conditional wizard pages — field behavior in ANY framework's form stays here. Not for: Angular (see `formio-angular`) or React-named (see `formio-react`) embedding; building an app (see `formio-application`) or its data model (see `formio-resource-planner`); REST endpoints (see `formio-api`); the raw SDK (see `formio-sdk`); creating a new form (see `formio-form-builder`); agent-filled forms or chats (see `formio-uag`).

references/wizards.md

View on GitHub
# Wizards — Conditional Pages and Custom Navigation

## Overview

Set `display: "wizard"` on the form definition and every top-level `panel` component becomes a page:

```json
{
  "display": "wizard",
  "components": [
    { "type": "panel", "key": "basics", "title": "Basics", "components": [ ... ] },
    { "type": "panel", "key": "extras", "title": "Extras", "components": [ ... ] },
    { "type": "panel", "key": "confirmation", "title": "Confirmation", "components": [ ... ] }
  ]
}
```

`Formio.createForm` returns a Wizard instance — everything in [javascript-api.md](./javascript-api.md) applies, plus the page API below.

## Page API

| Member                  | Meaning                                                    |
| ----------------------- | ---------------------------------------------------------- |
| `wizard.page`           | current page index (0-based)                               |
| `wizard.pages`          | the currently visible pages (conditional pages excluded)   |
| `wizard.nextPage()`     | validate the current page, then advance; returns a promise |
| `wizard.prevPage()`     | go back; returns a promise                                 |
| `wizard.setPage(index)` | jump straight to a visible page                            |

```js
const wizard = await Formio.createForm(el, wizardDefinition);
await wizard.nextPage(); // page 0 → 1 (validates page 0 first)
await wizard.prevPage(); // back to 0
```

`nextPage()` rejects when the current page fails validation — the wizard stays put and errors render on the offending components.

## Conditional wizard pages

A page is a `panel`, so it takes the same `conditional` shapes as any component (see [conditionals.md](./conditionals.md)). Skip the Extras page unless the user wants it:

```json
{
  "type": "panel",
  "key": "extras",
  "title": "Extras",
  "components": [
    { "type": "textfield", "key": "extraDetails", "label": "Extra Details", "input": true }
  ],
  "conditional": {
    "json": { "!==": [{ "var": "data.wantsExtras" }, "no"] }
  }
}
```

Hidden pages drop out of `wizard.pages` and the breadcrumb entirely — navigation flows straight from the page before to the page after, and the page's components stop validating. Flip the driving value back and the page rejoins in place.

## Custom navigation

Hide the built-in buttons and drive the wizard from your own UI:

```js
const wizard = await Formio.createForm(el, wizardDefinition, {
  buttonSettings: {
    showPrevious: false,
    showNext: false,
    showCancel: false,
    showSubmit: false,
  },
});

document.getElementById('myNext').addEventListener('click', () => wizard.nextPage());
document.getElementById('myBack').addEventListener('click', () => wizard.prevPage());
document.getElementById('myFinish').addEventListener('click', () => wizard.submit());
```

Track progress from wizard events: `wizard.on('nextPage')`, `wizard.on('prevPage')`, and `wizard.on('wizardPageSelected')` fire as the user moves; pair with `wizard.page`/`wizard.pages.length` to render a progress bar. `breadcrumbSettings: { clickable: false }` locks the breadcrumb when users must move strictly forward.

## See also

- [conditionals.md](./conditionals.md) — the conditional shapes pages accept.
- [options.md](./options.md) — `buttonSettings`, `breadcrumbSettings`.
- [javascript-api.md](./javascript-api.md) — events shared with plain forms.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall