force:canvasApp

Enables you to include a Force.com Canvas app in a Lightning component.

A force:canvasApp component represents a canvas app that's embedded in your Lightning component. You can create a web app in the language of your choice and expose it in Salesforce as a canvas app. Use the Canvas App Previewer to test and debug the canvas app before embedding it in a Lightning component.

If you have a namespace prefix, specify it using the namespacePrefix attribute. Either the developerName or applicationName attribute is required. This example embeds a canvas app in a Lightning component.

<aura:component>
    <force:canvasApp developerName="MyCanvasApp" namespacePrefix="myNamespace" />
</aura:component />

For more information on building canvas apps, see the Force.com Canvas Developer's Guide.

Attributes

Attribute Name Attribute Type Description Required?
applicationName String Name or label of the canvas app. Used to display the app's name while Canvas is loading.
body Component[] The body of the component. In markup, this is everything in the body of the tag.
border String Width of the canvas app border, in pixels. If not specified, defaults to 0 px.
canvasId String An unique label within a page for the Canvas app window. This should be used when targeting events to this canvas app.
containerId String An html element id in which canvas app is rendered. The container needs to be defined before canvasApp cmp usage.
developerName String API name of the canvas app. This name is defined when the canvas app is created and can be viewed in the Canvas App Previewer. Either developerName or referenceId is required.
displayLocation String The location in the application where the canvas app is currently being called from.
height String Canvas app window height, in pixels. If not specified, defaults to 900 px.
maxHeight String The maximum height of the Canvas app window in pixels. Defaults to 2000 px; 'infinite' is also a valid value.
maxWidth String The maximum width of the Canvas app window in pixels. Defaults to 1000 px; 'infinite' is also a valid value.
namespacePrefix String Namespace value of the Developer Edition organization in which the canvas app was created. Optional if the canvas app wasn’t created in a Developer Edition organization. If not specified, defaults to null.
onCanvasAppError String Name of the JavaScript function to be called if the canvas app fails to render.
onCanvasAppLoad String Name of the JavaScript function to be called after the canvas app loads.
onCanvasSubscribed String Name of the JavaScript function to be called after the canvas app registers with the parent.
parameters String Object representation of parameters passed to the canvas app. This should be supplied in JSON format or as a JavaScript object literal. Here’s an example of parameters in a JavaScript object literal: {param1:'value1',param2:'value2'}. If not specified, defaults to null.
referenceId String The referenceId attribute is deprecated. Use developerName instead.
scrolling String Canvas window scrolling
sublocation String The sublocation is the location in the application where the canvas app is currently being called from, for ex, displayLocation can be PageLayout and sublocation can be S1MobileCardPreview or S1MobileCardFullview, etc
title String Title for the link
watermark Boolean Renders a link if set to true
width String Canvas app window width, in pixels. If not specified, defaults to 800 px.