[**@wocart/theme v4.1.0**](../../README)

***

[@wocart/theme](../../README) / [index](../README) / insertInstance

# Function: insertInstance()

> **insertInstance**(`theme`, `page`, `instance`, `placement?`): [`DocumentEdit`](../type-aliases/DocumentEdit)

Insert a new instance — from `createInstance` or `instantiatePreset` — at a
placement, completed with its fixed and required blocks. Refused when the
component is not insertable, not available on the document's surface, not
placeable there, when the list is full or already holds the most of its
type, when the document would pass its caps, or when any id is already in
the document.

## Parameters

### theme

[`ThemeDefinition`](../interfaces/ThemeDefinition)

### page

[`PageData`](../interfaces/PageData)

### instance

[`ComponentInstance`](../interfaces/ComponentInstance)

### placement?

[`InstancePlacement`](../interfaces/InstancePlacement)

## Returns

[`DocumentEdit`](../type-aliases/DocumentEdit)
