Configure the layer and page list — which parts of it your users get, where it opens, what it shows, and which commands each row offers.

The layer and page list is the panel the dock’s Layers button opens. It shows the document’s pages above the layers of the page being worked on, one row per block, and each row selects, renames, hides, locks and reorders the block it stands for.
This guide covers the three APIs that configure it, each in its own section below:
- Enable / Disable — the
ly.img.layerListfeature decides which parts of the list exist, which sections it shows, and whether picking a row moves the canvas. See Disable or Enable Features. - Opening the List — the Panel API opens, places and floats it; the dock order decides where its button sits.
- Row Menu — the Component Order API drives the menu on each row, per row kind.
For what the list does once it is on screen — selection, drag-to-reorder, the keyboard — see Layers.
Enable / Disable#
The list is one feature, ly.img.layerList. Its options each control one part of the list, so switching one off leaves the rest working.
// Each row control is an option, so turning one off leaves the rest of// the list working.cesdk.features.configure({ 'ly.img.layerList': { options: { lock: { enabled: false } } }});| Option or setting | Controls |
|---|---|
pages |
The pages section |
layers |
The layers section |
visibility |
The hide/show toggle on a row |
lock |
The lock toggle on a row |
reorder |
Dragging a row to reorder it |
rename |
Renaming a row in place |
combined |
Setting. One tree of every page with its layers, in place of the two sections |
canvasFollow |
Setting. Which row picks scroll the canvas: 'none', 'pages' or 'all' |
thumbnails |
Setting. Whether rows show a thumbnail |
startCollapsed |
Setting. 'none' (default) or 'spreads': every page spread starts collapsed |
The pages option has settings of its own: layout, labels and pageTitle choose how pages show and what they are called, and rowSize, thumbnailShape and icons how page rows look. The layers option has rowSize, thumbnailShape and icons for layer rows. See Page Layout, Row Size and Icons below.
Switching ly.img.layerList off removes the panel and everything in it. The design and advanced editor configurations switch it on with combined off, so the list shows the two sections, and turn icons on for pages and layers.
Sections#
Two options and a setting choose what the list shows. With pages and layers on, the pages sit above the current page’s layers. Switching one of the two off leaves the other on its own. The combined setting replaces both with a single tree of every page and its layers.
// The pages sit above the current page's layers. `combined` would replace// both with one tree of every page and its layers.cesdk.features.configure({ 'ly.img.layerList': { enabled: true, options: { pages: { enabled: true }, layers: { enabled: true } } // combined: true }});Page Layout#
The layout setting of the pages option chooses how the page list draws pages. The default, 'list', gives each page a row, and a page spread a row that opens to a row for each of its pages. 'strip' gives each page a row with its picture, and shows a spread as one row with the pictures of its pages side by side. A click on a picture selects that page, and dragging it moves the page within its spread. Dragging the row moves the whole spread. A strip always shows pictures, whatever thumbnails says, and startCollapsed applies to the list only.
When every page of the document is a spread, the heading of the page list reads “Spreads” in both layouts.
Two more settings choose the names:
labelsdecides which names a strip shows:'all'(default) the spread titles and the page names,'pages'only the page names under the pictures, and'none'only the pictures. A hidden name still shows when the pointer rests on its picture. It has no effect on a list.pageTitledecides how a page or a spread is titled, in both layouts:'both'(default) is its number and its name,'number'the number alone, and'name'the name alone. A page named Lisbon reads “Page 3 · Lisbon” with'both'and “Page 3” with'number'. A page or spread without a name always shows its number.
Like any setting, layout can be a function, so the list can follow the document. Here the page list becomes a strip once the scene holds a spread, and goes back to a list when the last one is removed:
// The page list shows a strip of page pictures once the scene holds a page// spread, and a row per page until then. Each page is captioned by its name.cesdk.features.configure({ 'ly.img.layerList': { options: { pages: { layout: ({ engine }) => engine.scene .getPages() .some((page) => engine.block .getChildren(page) .some( (child) => engine.block.getType(child) === '//ly.img.ubq/pageSlice' ) ) ? 'strip' : 'list', labels: 'pages', pageTitle: 'name' } } }});Row Size#
The rowSize setting sets the height of a row in pixels, from 32 to 160, and the picture fills the row. On the pages option it applies to the rows of pages, spreads and pages of a spread; on the layers option to every other row, in the combined tree too. The default, 'auto', gives a plain row without pictures, and a row of 68 pixels with a picture of 64 pixels with them. Set a smaller rowSize to keep rows compact while showing pictures.
The thumbnailShape setting chooses the picture’s shape: 'square' (default) keeps the pictures in one column, and 'original' draws each in its block’s own shape, so a landscape page shows as landscape. The pages of a spread, and every page in a strip, always show in their own shape. The setting takes effect only with thumbnails on.
// Tall page rows with pictures in the page's own shape, beside compact// layer rows.cesdk.features.configure({ 'ly.img.layerList': { thumbnails: true, options: { pages: { rowSize: 120, thumbnailShape: 'original' }, layers: { rowSize: 32 } } }});Icons#
The icons setting shows the icon of a row’s block type, such as text or image, in front of its name. It starts off. On the pages option it applies to the rows of pages and spreads, and on the layers option to every other row. It does not depend on thumbnails: a row can show its picture, its icon, both or neither. A strip draws its pages as pictures, so icons on pages does nothing there.
// The type icon in front of each name, on page rows and on layer rows.cesdk.features.configure({ 'ly.img.layerList': { options: { pages: { icons: true }, layers: { icons: true } } }});Canvas Follow#
The canvasFollow setting decides whether picking a row moves the canvas. Its default, 'pages', follows a page row only, so navigating between pages works while clicking a layer already on screen leaves the canvas alone. 'all' follows every row, and 'none' follows none. It scrolls rather than zooms, so the zoom level is left where the user put it.
// By default picking a page row scrolls the canvas to it and picking a// layer row leaves the canvas alone. `'all'` follows every row; `'none'`// follows none.cesdk.features.configure({ 'ly.img.layerList': { canvasFollow: 'all' } });Page List Height#
The Pages section grows with its rows up to about ten rows, then scrolls. The layerList.pagesSection.setHeight action changes that: a number for height fixes the section at that many pixels, 'auto' lets it grow with its rows again, and maxHeight caps it. Users can still drag the line under the section to resize it. That size lasts until the page reloads, and the next call to the action replaces it.
// Cap the Pages section at 200 pixels. Dragging the line under it still// resizes it until the page reloads.await cesdk.actions.run('layerList.pagesSection.setHeight', { height: 'auto', maxHeight: 200});Opening the List#
The list is a panel like any other, registered under the id //ly.img.panel/layers. Open it with cesdk.ui.openPanel(), close it with cesdk.ui.closePanel(), and read its state with cesdk.ui.isPanelOpen().
// The list is a panel like any other, so the Panel API opens it.cesdk.ui.openPanel('//ly.img.panel/layers');It takes the same placement APIs as the inspector and the asset library. cesdk.ui.setPanelPosition() moves it between the two sides, and cesdk.ui.setPanelFloating() decides whether it floats over the canvas or docks beside it. It belongs to no panel group, so an asset library opened over it does not close it.
// Place it beside the canvas rather than floating over it.cesdk.ui.setPanelPosition('//ly.img.panel/layers', 'left');cesdk.ui.setPanelFloating('//ly.img.panel/layers', false);The Dock Button#
The Layers button is an ordinary dock entry: ly.img.assetLibrary.dock with the key ly.img.layerList, no entries, and a click handler that opens and closes the panel. The design and advanced editor configurations end their dock order with a spacer, a separator and that entry, which holds it at the bottom.
{ id: 'ly.img.assetLibrary.dock', key: 'ly.img.layerList', icon: '@imgly/Layers', label: 'component.layerList', entries: [], isSelected: () => cesdk.ui.isPanelOpen('//ly.img.panel/layers'), onClick: () => { if (cesdk.ui.isPanelOpen('//ly.img.panel/layers')) { cesdk.ui.closePanel('//ly.img.panel/layers'); } else { cesdk.ui.openPanel('//ly.img.panel/layers'); } }}The spacer takes the leftover room, so a dock button appended with position: 'end' lands below the Layers button. Pass before: 'ly.img.spacer' to keep your own button up with the asset libraries.
cesdk.ui.insertOrderComponent( { in: 'ly.img.dock', before: 'ly.img.spacer' }, { id: 'ly.img.assetLibrary.dock', key: 'my-library', entries: ['my.library'] });An integration that opens the list from its own control removes the built-in button and keeps the panel:
cesdk.ui.removeOrderComponent({ in: 'ly.img.dock', match: { id: 'ly.img.assetLibrary.dock', key: 'ly.img.layerList' }});For the rest of the dock order, see Dock.
Row Menu#
The menu on each row is a Component Order API area identified by ly.img.layerList.menu. A page row and a layer row hold separate orders, selected with the rowKind context. An order read or written without a when clause is the layer row’s.
// Without a `when` clause the layer row order is returned.const layerMenu = cesdk.ui.getComponentOrder({ in: 'ly.img.layerList.menu'});console.log('Default layer row menu:', layerMenu);
const pageMenu = cesdk.ui.getComponentOrder({ in: 'ly.img.layerList.menu', when: { rowKind: 'page' }});console.log('Default page row menu:', pageMenu);Default Menu Order#
A layer row offers rename, duplicate and delete, then group and ungroup, then the four arrange commands, with separators between the three runs.
A page row offers rename, duplicate and delete, then add page above and add page below. On a page of a spread, lock follows rename; on a spread row, the add entries add a spread. A page has no place in the stacking order and cannot be grouped, so those commands are absent from its menu rather than present and disabled.
Built-in Component IDs#
These IDs are available for a row menu order, alongside any component you register yourself.
| Component ID | Description |
|---|---|
ly.img.separator |
Visual divider between groups |
ly.img.layerList.menu.rename |
Rename the block in place |
ly.img.layerList.menu.lock |
Lock or unlock a page of a spread, which holds its place |
ly.img.layerList.menu.duplicate |
Duplicate the block |
ly.img.layerList.menu.delete |
Delete the block |
ly.img.layerList.menu.group |
Group the selected blocks |
ly.img.layerList.menu.ungroup |
Dissolve the selected group |
ly.img.layerList.menu.bringToFront |
Move in front of every sibling |
ly.img.layerList.menu.bringForward |
Move one step towards the front |
ly.img.layerList.menu.sendBackward |
Move one step towards the back |
ly.img.layerList.menu.sendToBack |
Move behind every sibling |
ly.img.layerList.menu.page.addAbove |
Add a page above this one, or a spread above a spread |
ly.img.layerList.menu.page.addBelow |
Add a page below this one, or a spread below a spread |
Trimming the Menu#
cesdk.ui.removeOrderComponent() drops an entry. Here the four arrange commands come out of the layer row’s menu, leaving dragging a row and the bracket shortcuts as the ways to reorder a block.
// Drop the four arrange commands from a layer row's menu. Dragging a row// and the bracket shortcuts still reorder blocks.( [ 'ly.img.layerList.menu.bringToFront', 'ly.img.layerList.menu.bringForward', 'ly.img.layerList.menu.sendBackward', 'ly.img.layerList.menu.sendToBack' ] as const).forEach((match) => { cesdk.ui.removeOrderComponent({ in: 'ly.img.layerList.menu', match });});cesdk.ui.setComponentOrder() replaces an order outright, and cesdk.ui.updateOrderComponent() edits an entry in place — to relabel it, or to disable it under a condition.
Adding Your Own Entry#
A custom entry is a component registered with cesdk.ui.registerComponent() and inserted into the order. Passing when: { rowKind: 'page' } puts it on page rows only.
// A custom entry is a registered component like any other.cesdk.ui.registerComponent( 'ly.img.layerList.menu.copyName', ({ builder, engine }) => { const [block] = engine.block.findAllSelected(); builder.Button('ly.img.layerList.menu.copyName', { label: 'Copy Name', icon: '@imgly/Copy', isDisabled: block == null, onClick: () => { if (block == null) return; void navigator.clipboard.writeText(engine.block.getName(block)); } }); });
// Page rows only, so a layer row's menu is left alone.cesdk.ui.insertOrderComponent( { in: 'ly.img.layerList.menu', when: { rowKind: 'page' }, after: 'ly.img.layerList.menu.delete' }, 'ly.img.layerList.menu.copyName');A command from a row’s menu applies to the whole selection when the row it was opened from is part of that selection, and to that row alone otherwise.
For every matcher and position option these methods accept, see Component Order API.
Troubleshooting#
No Layers button in the dock: the editor configuration has no entry keyed ly.img.layerList in its dock order. Only the design and advanced editor configurations declare one.
A custom dock button sits below the Layers button: it was appended with position: 'end', which lands past the spacer the configuration ends with. Insert it with before: 'ly.img.spacer' instead.
Rows carry no padlock: either the lock option is off, or the active role lacks the ui/fixLayers scope.
A page cannot be dragged: it is locked, or a template denies it the layer/move scope. Such a page keeps its place, and no other page can be dropped past it. With the move option of ly.img.page off, the pages of a spread cannot be dragged. In a strip, a press on one drags its whole spread instead.
Captions are cut short in a strip: a caption is as wide as its picture. Set a larger rowSize, set pageTitle to 'number' or 'name' for a shorter caption, or set labels to 'none'. The full title still shows when the pointer rests on a picture.
Rows show no type icon: the icons setting of their list is off, which is the default. Set icons to true on the pages option, the layers option or both.
The list shows one tree instead of two sections: the combined setting is true. Set it to false.
A menu change does not reach page rows: the order was set without when: { rowKind: 'page' }, so it applied to layer rows. Page rows read their own order.
API Reference#
| Method | Purpose |
|---|---|
cesdk.features.configure({ 'ly.img.layerList': { … } }) |
Switch the list or an option on or off, and set its settings |
cesdk.features.get('ly.img.layerList') |
Read how the list is configured |
cesdk.ui.openPanel('//ly.img.panel/layers') |
Open the list |
cesdk.ui.closePanel('//ly.img.panel/layers') |
Close the list |
cesdk.ui.isPanelOpen('//ly.img.panel/layers') |
Read whether the list is open |
cesdk.ui.setPanelPosition(id, position) |
Place the list on the left or the right |
cesdk.ui.setPanelFloating(id, floating) |
Float the list over the canvas |
cesdk.actions.run('layerList.pagesSection.setHeight', settings) |
Fix or cap the height of the Pages section |
cesdk.ui.getComponentOrder({ in, when }) |
Read a row menu order |
cesdk.ui.setComponentOrder({ in, when }, order) |
Replace a row menu order |
cesdk.ui.insertOrderComponent({ in, when, before }, c) |
Insert an entry into a row menu |
cesdk.ui.updateOrderComponent({ in, when, match }, update) |
Edit an entry of a row menu |
cesdk.ui.removeOrderComponent({ in, when, match }) |
Remove an entry from a row menu, or the dock button |
cesdk.ui.registerComponent(id, renderFunction) |
Register a custom row menu entry |
Next Steps#
- Layers - What the list does once it is on screen, and the block APIs behind it
- Component Order API - Every matcher and option a row menu order accepts
- Dock - Move, replace, or remove the Layers button
- Panel - Place and float the list alongside the other panels