Search
Loading...
Skip to content

Hide Elements

CE.SDK provides flexible APIs to control the visibility of every UI element. You can hide elements using the Feature API (which completely removes features from the UI), ordering APIs (which control what appears in ordered lists like navigation bars), or panel management APIs (which control panel state). This guide demonstrates how to hide and show different UI elements to create custom editing experiences tailored to your application’s needs.

Hide Elements example showing CE.SDK with various UI elements hidden

10 mins
estimated time
Download
StackBlitz
GitHub

Understanding UI Element Hiding Approaches#

CE.SDK provides three methods to control UI visibility: the Feature API for disabling features entirely, ordering APIs for controlling component layout, and panel management for dynamic show/hide behavior.

Hiding Elements with the Feature API#

The Feature API is the primary way to hide UI elements in CE.SDK. When you disable a feature, it’s completely removed from the interface. You can hide various UI components including:

  • Navigation Bar (ly.img.navigation.bar) - Contains buttons like back, close, undo/redo, and zoom controls
  • Inspector Bar (ly.img.inspector.bar) - Provides access to block properties and editing controls
  • Dock (ly.img.dock) - Sidebar that provides quick access to assets and tools
  • Notifications (ly.img.notifications) - Toast messages for actions like undo and redo

Here’s how to disable and hide the dock:

// Hide the entire dock using Feature API
cesdk.feature.disable('ly.img.dock');

And how to disable and hide canvas elements:

// Hide canvas bar and canvas menu using Feature API
cesdk.feature.disable(['ly.img.canvas.bar', 'ly.img.canvas.menu']);

By passing an array to feature.disable(), you can hide multiple features in a single call. The Feature API also supports glob patterns with wildcards (*) for batch operations, and you can check feature state with isEnabled() before making changes.

Hiding Elements with Ordering APIs#

Ordering APIs provide an alternative method for hiding UI elements by controlling what appears in component lists. Setting an empty order array removes all components from that area. This approach doesn’t disable features - it just controls layout.

// Hide UI elements using ordering APIs (alternative method)
// Setting empty array removes all components
cesdk.ui.setDockOrder([]);
cesdk.ui.setCanvasBarOrder([], 'top');
cesdk.ui.setCanvasMenuOrder([]);

The key difference between ordering APIs and the Feature API is that ordering APIs only affect visual layout. The underlying features remain enabled and can still be accessed programmatically.

Managing Panel Visibility#

Panels in CE.SDK can be opened and closed dynamically using the panel management APIs. This allows you to create context-sensitive interfaces that show relevant panels based on user actions.

// Close all panels using wildcard pattern
cesdk.ui.closePanel('//ly.img.panel/*');
// Check if panels are open
const inspectorPanelId = '//ly.img.panel/inspector';
const isInspectorOpen = cesdk.ui.isPanelOpen(inspectorPanelId);
console.log('Inspector panel open:', isInspectorOpen);
// Find all panels
const allPanels = cesdk.ui.findAllPanels();
console.log('All panels:', allPanels);

Using Glob Patterns#

The Feature API supports glob patterns for batch operations. This makes it easy to enable or disable groups of related features.

// Using glob patterns to control multiple features
const navigationFeatures = cesdk.feature.list({
matcher: 'ly.img.navigation.*'
});
console.log('Navigation features:', navigationFeatures);

API Reference#

MethodDescription
cesdk.feature.enable(featureId)Enable a feature
cesdk.feature.disable(featureId)Disable a feature or array of features
cesdk.feature.isEnabled(featureId)Check if a feature is enabled
cesdk.feature.list({ matcher })List features matching a glob pattern
cesdk.ui.setNavigationBarOrder(order)Set navigation bar component order
cesdk.ui.setCanvasBarOrder(order, position)Set canvas bar component order
cesdk.ui.setCanvasMenuOrder(order)Set canvas menu component order
cesdk.ui.setDockOrder(order)Set dock component order
cesdk.ui.setInspectorBarOrder(order)Set inspector bar component order
cesdk.ui.openPanel(panelId)Open a panel
cesdk.ui.closePanel(panelId)Close a panel (supports wildcards)
cesdk.ui.isPanelOpen(panelId)Check if a panel is open
cesdk.ui.findAllPanels(options)Find all panels with optional filtering

Next Steps#

After mastering UI element hiding, explore these related guides: