---
title: "insertContainer Method"
canonical: https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.printarea.insertcontainer.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["6.15.0", "6.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# insertContainer Method

**Applies to:** Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · **Archived documentation**
 
### Callable
 
- insertContainer(containerDefiniton:  [IChannelContainerDefinition](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.ichannelcontainerdefinition.htm.md), index:  number  |  string ) :  Promise &lt; [Container](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.container.htm.md) &gt;

- Inserts a channel container into the print area.
  
 - example
     - ```
    // Specify a container definition of a spot color.
    const containerDefinition = {
        name: "spot",
        type: "spotColor",
        previewColor: "rgba(0,255,0,1)"
    };
    const containerIndex = 4;
    
    // Load the editor.
    CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
        // If the editor has been successfully loaded.
        .then(function (editor) {
            // When we get the product.
            editor.getProduct().then(function (product) {
                // Insert a container.
                product.currentSurface.printAreas[0].insertContainer(containerDefinition, containerIndex);
            });
        });
    ```

#### Parameters

    - ##### containerDefiniton: [IChannelContainerDefinition](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.ichannelcontainerdefinition.htm.md) 
  
        A container to add.
    - ##### index: number  |  string 
  
        A position of this container in the array of containers, either numeric or string value (a value greater than two). For example, `"3"`.

#### Returns Promise &lt; Container &gt;
 
    An instance of the inserted container.
