Skip to content

Canvas Menu

There are 2 APIs for getting and setting the order of components in the Canvas Menu.

The content of the Canvas Menu changes based on the current edit mode ('Transform' (the default), 'Text', 'Crop', 'Trim', or a custom value), so both APIs accept an orderContext argument to specify the mode.

For example usage of these APIs, see also Moving Existing Buttons or Adding New Buttons in the Guides section.

Get the Current Order

cesdk.ui.getCanvasMenuOrder(
orderContext: OrderContext = { editMode: 'Transform' }
)

When omitting the orderContext parameter, the order for the 'Transform' edit mode is returned, e.g.

cesdk.ui.getCanvasMenuOrder();
// => [
// {id: 'ly.img.group.enter.canvasMenu'},
// {id: 'ly.img.group.select.canvasMenu'},
// ...
// ]

Set a new Order

setCanvasMenuOrder(
canvasMenuOrder: (CanvasMenuComponentId | OrderComponent)[],
orderContext: OrderContext = { editMode: 'Transform' }
)

When omitting the orderContext parameter, the order is set for the default edit mode ('Transform'), e.g.:

// Sets the order for transform mode by default
cesdk.ui.setCanvasMenuOrder(['my.component.for.transform.mode']);

Canvas Menu Components

The following lists the default Canvas Menu components available within CE.SDK.

Take special note of the “Feature ID” column. Most components can be hidden/disabled by disabling the corresponding feature using the Feature API.

Also note that many components are only rendered for the block types listed in the “Renders for” column, because their associated controls (e.g. font size) are only meaningful for specific kinds of blocks (e.g. text).

Layout Helpers

Component IDDescription
ly.img.separatorAdds a vertical separator (<hr> element) in the Canvas Menu.
Separators follow some special layouting rules:
- If 2 or more separators end up next to each other (e.g. due to other components not rendering), only 1 separator will be rendered.
- Separators that end up being the first or last element in the Canvas Menu will not be rendered.
- Separators directly adjacent to the left side of a spacer (see below) will not be rendered.

Common Controls

These components are useful for editing various different block types.

Component IDDescriptionFeature IDRenders for
ly.img.replace.canvasMenuReplace button:
Opens the “Replace” Panel offering to replace the current image or video fill.
ly.img.replaceImages, Videos
ly.img.placeholder.canvasMenuPlaceholder button:
Opens the “Placeholder” panel, allowing the user to toggle specific constraints on the selected block.
ly.img.placeholderEvery block
ly.img.duplicate.canvasMenuDuplicate button:
Duplicates the selected elements when pressed.
ly.img.duplicateEvery block
ly.img.delete.canvasMenuDelete button:
Deletes the selected elements when pressed.
ly.img.deleteEvery block

Text

These components are relevant for editing text blocks, and will only render when a text block is selected.

Component IDDescriptionFeature ID
ly.img.text.edit.canvasMenuEdit button:
Switches to text edit mode when pressed.
ly.img.text.edit
ly.img.text.color.canvasMenuColor swatch button:
Opens the Color Panel, where the user can set the color for the currently selected text run.
ly.img.fill
ly.img.text.bold.canvasMenuBold toggle:
Toggles the bold cut (if available) for the currently selected text run.
ly.img.text.edit
ly.img.text.italic.canvasMenuItalic toggle:
Toggles the italic cut (if available) for the currently selected text run.
ly.img.text.edit
ly.img.text.variables.canvasMenuInsert Variable button:
Opens a dropdown containing the selection of available text variables.

Groups

These controls will only render when a group or an element of a group is selected.

Component IDDescriptionFeature IDRenders for
ly.img.group.enter.canvasMenuEnter group button:
Moves selection to the first element of the group when pressed.
ly.img.groupGroups
ly.img.group.select.canvasMenuSelect group button:
Moves selection to the parent group of the currently selected element when pressed.
ly.img.groupElements within groups

Page

These controls will only render when a page is selected.

Component IDDescriptionFeature ID
ly.img.page.moveUp.canvasMenuMove Up/Left button:
Moves the current page closer to the start of a multi-page document.
ly.img.page.move
ly.img.page.moveDown.canvasMenuMove Down/Right button:
Moves the current page closer to the end of a multi-page document.
ly.img.page.move

Default Order

The default order of the Canvas Menu is the following:

Transform Mode

[
'ly.img.group.enter.canvasMenu',
'ly.img.group.select.canvasMenu',
'ly.img.page.moveUp.canvasMenu',
'ly.img.page.moveDown.canvasMenu',
'ly.img.separator',
'ly.img.text.edit.canvasMenu',
'ly.img.replace.canvasMenu',
'ly.img.separator',
'ly.img.placeholder.canvasMenu',
'ly.img.separator',
'ly.img.duplicate.canvasMenu',
'ly.img.delete.canvasMenu',
];

Text Mode

[
'ly.img.text.color.canvasMenu',
'ly.img.separator',
'ly.img.text.bold.canvasMenu',
'ly.img.text.italic.canvasMenu',
'ly.img.separator',
'ly.img.text.variables.canvasMenu',
];