This is an old documentation. Go to the latest Customer's Canvas docs

insertContainer Method


  • Inserts a channel container into the print area.

    // 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);


    • containerDefiniton: IChannelContainerDefinition

      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 < Container >

    An instance of the inserted container.