---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-patch.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-patch.md
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# div-patch
Edits the element.

## Parameters
| Parameters | Description |
| --- | --- |
| `changes` | <p>**array**</p><p>Required parameter.</p><p>Element changes.</p><p>An array must not be empty.</p> |
| `mode` | <p>**string**</p><p>Procedure for applying changes:<li>`transactional` — if an error occurs during application of at least one element, the changes aren't applied.</li><li>`partial` — all possible changes are applied. If there are errors, they are reported.</li></p><p>Possible values: `transactional`, `partial`.</p><p>Default value: `partial`.</p><p>Available platforms: Android, iOS, web.</p> |
| `on_applied_actions` | <p>**array**</p><p>Actions to perform after changes are applied.</p><p>Available platforms: Android, iOS, web.</p> |
| `on_failed_actions` | <p>**array**</p><p>Actions to perform if there’s an error when applying changes in transaction mode.</p><p>Available platforms: Android, iOS, web.</p> |

### change
| Parameters | Description |
| --- | --- |
| `id` | <p>**string**</p><p>Required parameter.</p><p>ID of an element to be replaced or removed.</p> |
| `items` | <p>**array**</p><p>Elements to be inserted. If the parameter isn't specified, the element will be removed.</p><p>List of possible values:<li>[div-image](div-image.md#div-image)</li><li>[div-gif-image](div-gif-image.md#div-gif-image)</li><li>[div-text](div-text.md#div-text)</li><li>[div-separator](div-separator.md#div-separator)</li><li>[div-container](div-container.md#div-container)</li><li>[div-grid](div-grid.md#div-grid)</li><li>[div-gallery](div-gallery.md#div-gallery)</li><li>[div-pager](div-pager.md#div-pager)</li><li>[div-tabs](div-tabs.md#div-tabs)</li><li>[div-state](div-state.md#div-state)</li><li>[div-custom](div-custom.md#div-custom)</li><li>[div-indicator](div-indicator.md#div-indicator)</li><li>[div-slider](div-slider.md#div-slider)</li><li>[div-switch](div-switch.md#div-switch)</li><li>[div-input](div-input.md#div-input)</li><li>[div-select](div-select.md#div-select)</li><li>[div-video](div-video.md#div-video)</li></p> |

<details>
<summary>JSON</summary>

```json
{
  changes*: [
    {
      id*: "string",
      items: [ div, ... ]
    },
    ...
  ],
  mode: "string",
  on_applied_actions: [
    {
      download_callbacks: {
        on_fail_actions: [ div-action, ... ],
        on_success_actions: [ div-action, ... ]
      },
      is_enabled: "bool_int",
      log_id*: "string",
      log_url: "string",
      menu_items: [
        {
          action: div-action,
          actions: [ div-action, ... ],
          text*: "string"
        },
        ...
      ],
      payload: "object",
      referer: "string",
      scope_id: "string",
      target: "string",
      typed: div-action-typed,
      url: "string"
    },
    ...
  ],
  on_failed_actions: [
    {
      download_callbacks: {
        on_fail_actions: [ div-action, ... ],
        on_success_actions: [ div-action, ... ]
      },
      is_enabled: "bool_int",
      log_id*: "string",
      log_url: "string",
      menu_items: [
        {
          action: div-action,
          actions: [ div-action, ... ],
          text*: "string"
        },
        ...
      ],
      payload: "object",
      referer: "string",
      scope_id: "string",
      target: "string",
      typed: div-action-typed,
      url: "string"
    },
    ...
  ]
}
```
</details>
