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/conditionals.md

View on GitHub
# Conditional Components

## Overview

A component's `conditional` property controls its visibility from other fields' values. Two mechanisms:

- **Simple** — `show` / `when` / `eq`: one driver field, one comparison value.
- **JSON Logic** — `conditional.json`: any expression; truthy shows the component. Syntax and operations live in [json-logic.md](./json-logic.md).

Hidden components are removed from validation and (by default) their values are cleared on submit (`clearOnHide`).

## Simple conditional

Show `employer` only while `employed` equals `yes`:

```json
{
  "type": "textfield",
  "key": "employer",
  "label": "Employer",
  "input": true,
  "conditional": {
    "show": true,
    "when": "employed",
    "eq": "yes"
  }
}
```

`show: false` inverts it — hide when the comparison matches.

## JSON Logic conditional

The same rule as an expression — and the doorway to multi-field, negated, or computed conditions:

```json
{
  "type": "textfield",
  "key": "employer",
  "label": "Employer",
  "input": true,
  "conditional": {
    "json": { "===": [{ "var": "data.employed" }, "yes"] }
  }
}
```

Inside `conditional.json`, `data` is the submission data and `row` is the contextual row (see [json-logic.md](./json-logic.md)). A multi-field example — show only for employed residents of Texas:

```json
{
  "conditional": {
    "json": {
      "and": [
        { "===": [{ "var": "data.employed" }, "yes"] },
        { "===": [{ "var": "data.state" }, "TX"] }
      ]
    }
  }
}
```

## Behavior notes

- Visibility re-evaluates on every data change; the component's `visible` property reflects the current state (`form.getComponent('employer').visible`).
- Set `"clearOnHide": false` on the component to keep its value while hidden.
- Wizard pages accept the same `conditional` shapes to skip whole pages — see [wizards.md](./wizards.md).

## See also

- [json-logic.md](./json-logic.md) — operations and `var` resolution.
- [field-logic.md](./field-logic.md) — conditions that change more than visibility.
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