Search Docs
Loading...
Skip to content

Dock

The dock is the vertical sidebar containing buttons that open asset library panels. This guide covers dock-specific features like appearance settings, edit mode contexts, and the asset source relationship.

Dock customization example showing large icons, hidden labels, and a custom settings button

10 mins
estimated time
Download
StackBlitz
GitHub

For adding and configuring dock buttons, see Add Dock Buttons. For general component manipulation (reordering, inserting, removing), see the Component Order API Reference.

This guide covers configuring dock appearance settings, setting up edit mode-specific layouts, understanding the relationship between dock entries and asset sources, adding custom registered components, and viewing the default component order.

Show or Hide the Dock#

Use the Feature API to control dock visibility:

// Hide the dock
cesdk.feature.disable('ly.img.dock');
// Show the dock (default)
cesdk.feature.enable('ly.img.dock');

For more on the Feature API, see Show/Hide Components.

Dock Appearance Settings#

Two editor settings control how dock buttons look. Set dock/iconSize to 'large' for 24px icons or 'normal' for the default 16px. Set dock/hideLabels to true to show icons only.. When hidden, labels appear as tooltips on hover.

// Configure dock to use large icons and hide text labels
cesdk.engine.editor.setSetting('dock/iconSize', 'large');
cesdk.engine.editor.setSetting('dock/hideLabels', true);
SettingValuesDescription
dock/iconSize'normal' | 'large'Button icon size (16px or 24px)
dock/hideLabelsbooleanHide text labels, show icons only

Edit Mode Context#

The dock supports different component orders for different edit modes. Use the when option in setComponentOrder to define a layout that activates only in a specific mode. The following example sets a simplified dock that appears only when the user enters Text edit mode.

// Set a simplified dock for Text edit mode
cesdk.ui.setComponentOrder(
{ in: 'ly.img.dock', when: { editMode: 'Text' } },
[
{
id: 'ly.img.assetLibrary.dock',
key: 'ly.img.text',
icon: '@imgly/Text',
label: 'libraries.ly.img.text.label',
entries: ['ly.img.text']
}
]
);

Available edit modes: 'Transform' (default), 'Text', 'Crop', 'Trim', or any custom value. All Component Order API methods accept an optional when context. See the Component Order API Reference for details.

Relationship with Asset Sources#

Asset sources, asset library entries, and dock buttons work together in three steps:

  1. Create an asset source — Register a source with the engine that stores and provides assets
  2. Create an asset library entry — Define a UI entry that references the source via sourceIds
  3. Add a dock button — Insert a button that opens the entry via the entries array
// Add a custom asset source, create an entry for it, and add a dock button
// Step 1: Create the asset source (stores/provides assets)
cesdk.engine.asset.addLocalSource('my.brand.assets');
// Step 2: Create an asset library entry (UI representation of the source)
cesdk.ui.addAssetLibraryEntry({
id: 'my.brand.entry',
sourceIds: ['my.brand.assets'],
previewLength: 3,
gridColumns: 3,
gridItemHeight: 'square'
});
// Step 3: Add a dock button that opens the entry
cesdk.ui.insertOrderComponent(
{ in: 'ly.img.dock', position: 'end' },
{
id: 'ly.img.assetLibrary.dock',
key: 'brand',
entries: ['my.brand.entry'],
label: 'Brand',
icon: '@imgly/Favorite'
}
);

The entries array on the dock button takes entry IDs, not source IDs. If the entry ID doesn’t exist, the button won’t appear.

Adding Custom Registered Components#

Register fully custom components and add them to the dock. Use cesdk.ui.registerComponent() to define a component with the builder pattern, then insert it into the dock order. A spacer pushes the custom button to the bottom of the dock.

// Register a custom component and add it to the dock bottom
cesdk.ui.registerComponent('my.settings.button', ({ builder }) => {
builder.Button('settings', {
label: 'Settings',
icon: '@imgly/Settings',
onClick: () => {
cesdk.ui.showNotification({
message: 'Settings panel would open here',
type: 'info',
duration: 'short'
});
}
});
});
cesdk.ui.insertOrderComponent({ in: 'ly.img.dock', position: 'end' }, [
'ly.img.spacer',
'my.settings.button'
]);

For the complete builder API documentation, see Register a New Component.

Default Component Order#

Retrieve the current dock order with getComponentOrder to inspect the default layout. For detailed descriptions of each component ID, see the Component Reference.

// Retrieve and log the current dock order for reference
const currentOrder = cesdk.ui.getComponentOrder({
in: 'ly.img.dock'
});
console.log('Current dock order:', currentOrder);

Asset Library Buttons#

Component IDDescription
ly.img.assetLibrary.dockAsset library button (configurable with key, label, icon, entries)

Layout#

KeyTypeDescription
keystringUnique identifier within the dock.
labelstringButton label. If a matching I18N key is found, it is localized.
iconCustomIconA URL string pointing to an SVG, a built-in icon ID (see Icons), or a callback returning a URL.
entriesstring[]Asset entries shown when the button is pressed. A single entry opens directly; multiple entries show a group overview.
onClick() => voidCustom click handler. If provided, overrides the default asset library toggle behavior.
isSelectedboolean | (() => boolean)Controls the selected state of the button.
isDisabledboolean | (() => boolean)Controls the disabled state of the button.
size'normal' | 'large'Size of the button. Defaults to 'normal'.
variant'regular' | 'plain'Visual variant of the button. Defaults to 'regular'.
color'accent' | 'danger'Color scheme of the button.

Edit Mode Context#

The dock order can vary based on the current edit mode. Pass an orderContext parameter to configure different dock orders for Transform, Text, Crop, Trim, or custom edit modes:

// Set dock order for Text edit mode
cesdk.ui.setDockOrder(components, { editMode: 'Text' });
// Get dock order for Crop edit mode
const cropOrder = cesdk.ui.getDockOrder({ editMode: 'Crop' });

API Reference#

MethodPurpose
cesdk.ui.getDockOrder()Get current dock component order
cesdk.ui.setDockOrder()Set complete dock component order
cesdk.ui.updateDockOrderComponent()Update existing dock components
cesdk.ui.removeDockOrderComponent()Remove dock components
cesdk.ui.insertDockOrderComponent()Insert new dock components
cesdk.ui.registerComponent()Register custom components for dock use
cesdk.engine.editor.setSetting()Configure dock appearance settings