Search Docs
Loading...
Skip to content

Disable or Enable Features

Control which editor features are available to users using the Feature API.

Disable or Enable Features example showing the CE.SDK editor with feature controls

10 mins
estimated time
Download
StackBlitz
GitHub

The Feature API provides global control over feature visibility throughout the editor. Use it to hide delete buttons from certain users, disable crop controls based on context, or conditionally enable features based on user roles or selection state. Unlike the Component Order API which targets specific components in specific areas, the Feature API affects features everywhere in the editor at once.

This guide covers how to enable and disable features with simple toggles, create custom predicates for conditional feature access, use glob patterns for bulk operations, and debug feature configurations.

Feature API Methods#

The following table summarizes the main Feature API methods and when to use each:

Method Use Case
cesdk.feature.enable() Enable features with their default predicates
cesdk.feature.disable() Disable features (hide from UI)
cesdk.feature.set() Set features with custom predicates or boolean values
cesdk.feature.isEnabled() Check if a feature is currently enabled
cesdk.feature.list() Discover registered feature IDs
cesdk.feature.get() Get predicate chain for debugging

Enable Features#

Use cesdk.feature.enable() to activate a feature with its default predicate behavior. The method accepts a single feature ID, an array of IDs, or a glob pattern.

// Enable delete feature with default predicate
cesdk.feature.enable('ly.img.delete');

You can enable multiple features at once by passing an array:

// Enable multiple features at once
cesdk.feature.enable(['ly.img.duplicate', 'ly.img.group']);

Glob patterns allow you to enable all features matching a pattern. The * wildcard matches any sequence of characters:

// Enable all video features using glob pattern
cesdk.feature.enable('ly.img.video*');

Disable Features#

Use cesdk.feature.disable() to hide features from the UI. Like enable(), it accepts single IDs, arrays, or glob patterns.

// Disable crop feature
cesdk.feature.disable('ly.img.crop');

Disable multiple features at once by passing an array:

// Disable multiple features at once
cesdk.feature.disable(['ly.img.notifications', 'ly.img.preview']);

Use glob patterns to disable all features matching a pattern:

// Disable all transform features using glob pattern
cesdk.feature.disable('ly.img.transform*');

Custom Predicates#

The cesdk.feature.set() method allows you to configure features with custom logic. You can pass a boolean value or a function predicate.

Boolean Predicates#

Passing true or false creates a terminal predicate that overrides any enable() or disable() calls:

// Set feature with boolean (terminal predicate)
cesdk.feature.set('ly.img.fill', true);

Function Predicates#

Function predicates receive a context object with engine, isPreviousEnable(), and defaultPredicate(). Use them for dynamic conditions based on selection or other state:

// Set feature with custom predicate based on selection
cesdk.feature.set('ly.img.duplicate', ({ engine }) => {
return engine.block.findAllSelected().length > 0;
});

This predicate enables the duplicate feature only when at least one block is selected.

Extending Default Behavior#

You can build on a feature’s default predicate using defaultPredicate(). This lets you add conditions while preserving the built-in logic:

// Extend default predicate with additional condition
cesdk.feature.set('ly.img.delete', ({ defaultPredicate, engine }) => {
// Only allow delete when a block is selected
return defaultPredicate() && engine.block.findAllSelected().length > 0;
});

Layering Conditions#

Use isPreviousEnable() to chain with previously registered predicates. This enables layered conditions from multiple set() calls:

// Chain multiple predicates using isPreviousEnable
cesdk.feature.set('ly.img.replace', ({ isPreviousEnable, engine }) => {
const previousResult = isPreviousEnable();
const hasSelection = engine.block.findAllSelected().length > 0;
return previousResult && hasSelection;
});

Evaluation Order#

When multiple predicates are registered for a feature, they evaluate in this order:

  1. Most recent set() predicates run first
  2. Older set() predicates in reverse chronological order
  3. enable()/disable() state runs last

Boolean predicates are terminal and immediately return their value without continuing the chain. Function predicates control whether to continue by calling isPreviousEnable() or returning directly.

Glob Patterns#

All main Feature API methods support glob pattern matching for bulk operations. The * wildcard matches any sequence of characters within a segment.

Supported methods:

  • cesdk.feature.enable('ly.img.video.*') - Enable all video features
  • cesdk.feature.disable('ly.img.crop.*') - Disable all crop features
  • cesdk.feature.set('ly.img.navigation.*', predicate) - Set all navigation features
  • cesdk.feature.isEnabled('ly.img.video.*') - Check if ALL matching features are enabled
  • cesdk.feature.list({ matcher: 'ly.img.video.*' }) - List matching features

Check Feature Status#

Use cesdk.feature.isEnabled() to query if a feature is currently enabled:

// Check if a feature is enabled
const isDeleteEnabled = cesdk.feature.isEnabled('ly.img.delete');
console.log('Delete feature enabled:', isDeleteEnabled);

When using a glob pattern with isEnabled(), it returns true only if all matching features are enabled:

// Check if all video features are enabled (returns true only if ALL match)
const allVideoEnabled = cesdk.feature.isEnabled('ly.img.video*');
console.log('All video features enabled:', allVideoEnabled);

Discover Features#

Use cesdk.feature.list() to get all registered feature IDs. You can filter with the optional matcher parameter:

// List all registered feature IDs
const allFeatures = cesdk.feature.list();
console.log('All features:', allFeatures.slice(0, 10), '...');

Filter the list with a glob pattern:

// List features matching a pattern
const navigationFeatures = cesdk.feature.list({
matcher: 'ly.img.navigation*'
});
console.log('Navigation features:', navigationFeatures);

Built-in Features#

CE.SDK includes many built-in features organized by category:

Feature ID Description
ly.img.navigation Parent key: enables all navigation child features
ly.img.navigation.bar Controls visibility of the Navigation Bar
ly.img.navigation.back Controls visibility of the “Back” button
ly.img.navigation.close Controls visibility of the “Close” button
ly.img.navigation.undoRedo Controls visibility of “Undo” and “Redo” buttons
ly.img.navigation.zoom Controls visibility of zoom controls
ly.img.navigation.actions Controls visibility of navigation actions
ly.img.navigation.documentSettings Controls visibility of the document settings button

Inspector Features#

Feature ID Description
ly.img.inspector.bar Controls visibility of the Inspector Bar
ly.img.inspector.panel Controls visibility of the Advanced Inspector
ly.img.inspector.toggle Controls presence of the Inspector Toggle button

Canvas Features#

Feature ID Description
ly.img.canvas Parent key: enables all canvas child features
ly.img.canvas.bar Controls visibility of the Canvas Bar
ly.img.canvas.menu Controls visibility of the Canvas Menu

Editing Features#

Feature ID Description
ly.img.delete Controls ability to delete blocks
ly.img.duplicate Controls ability to duplicate blocks
ly.img.replace Controls presence of the Replace button (parent flag for all replace sub-features)
ly.img.replace.fill Controls replacing image/video fill content
ly.img.replace.shape Controls replacing block shape
ly.img.replace.audio Controls replacing audio block content
ly.img.group Controls grouping functionality
ly.img.group.create Controls grouping multiple selected blocks
ly.img.group.ungroup Controls dissolving a group
ly.img.group.enter Controls entering a group for editing
ly.img.group.select Controls selecting the parent group
ly.img.combine Controls boolean/combine operations
ly.img.combine.union Controls the Union boolean operation
ly.img.combine.subtract Controls the Subtract boolean operation
ly.img.combine.intersect Controls the Intersect boolean operation
ly.img.combine.exclude Controls the Exclude (XOR) boolean operation
ly.img.position Controls the position/arrange/align panel
ly.img.position.arrange Controls bring forward/backward/front/back and pin
ly.img.position.align Controls alignment (left, right, center, top, bottom)
ly.img.position.distribute Controls distribute vertically/horizontally
ly.img.placeholder Controls Placeholder toggle visibility in Inspector

Video Features#

Feature ID Description
ly.img.video Parent key: enables all video child features
ly.img.video.timeline Controls visibility of the Video Timeline
ly.img.video.timeline.clips Controls visibility of video clips track
ly.img.video.timeline.overlays Controls visibility of overlays track
ly.img.video.timeline.audio Controls visibility of audio track
ly.img.video.timeline.addClip Controls ability to add clips
ly.img.video.timeline.controls Controls base video control UI
ly.img.video.timeline.controls.toggle Controls timeline collapse/expand toggle
ly.img.video.timeline.controls.background Controls background color controls
ly.img.video.timeline.controls.playback Controls play/pause and timestamp
ly.img.video.timeline.controls.loop Controls loop toggle
ly.img.video.timeline.controls.split Controls split clip control
ly.img.video.timeline.controls.timelineZoom Controls timeline zoom controls
ly.img.video.caption Controls video captions

Text Features#

Feature ID Description
ly.img.text Parent key: enables all text child features
ly.img.text.edit Controls presence of the Edit button. The text color panel’s sub-controls are gated via the fill sub-keys (ly.img.fill.color.*).
ly.img.text.typeface Controls the typeface selection that opens the typeface library
ly.img.text.fontSize Controls font size input
ly.img.text.fontStyle Controls bold/italic toggles
ly.img.text.decoration Controls underline/strikethrough toggles
ly.img.text.alignment Controls text alignment
ly.img.text.list Parent key: enables all list style child features
ly.img.text.list.unordered Controls bulleted list
ly.img.text.list.ordered Controls numbered list
ly.img.text.advanced Controls advanced text options
ly.img.text.path Parent key: enables all text-on-path child features
ly.img.text.path.curve Controls the curve picker for placing text on a path or circle
ly.img.text.path.position Controls the text position relative to the path
ly.img.text.path.direction Controls the text direction along the path
ly.img.text.path.offset Controls the text offset along the path
ly.img.text.path.edit Controls the Edit Path button that enters path editing
ly.img.text.background Controls text background
ly.img.text.background.picker Controls the color picker inside the text background color panel
ly.img.text.background.picker.opacity Controls the alpha/opacity slider inside the text background color panel
ly.img.text.background.library Controls the swatch library inside the text background color panel
ly.img.text.styles Controls the Styles button that applies a style preset to a text or caption block

Effects Features#

Feature ID Description
ly.img.fill Controls Fill button and Fill Panel
ly.img.fill.color Controls solid and gradient fill controls
ly.img.fill.color.picker Controls the color picker inside the fill color panel
ly.img.fill.color.picker.gradient Controls the gradient mode selector and stops editor inside the fill color panel
ly.img.fill.color.picker.opacity Controls the alpha/opacity slider inside the fill color panel
ly.img.fill.color.library Controls the swatch library inside the fill color panel
ly.img.fill.image Controls image fill controls and crop
ly.img.fill.video Controls video fill, trim, volume, speed
ly.img.stroke Controls Stroke controls
ly.img.stroke.color Controls stroke color picker
ly.img.stroke.color.picker Controls the color picker inside the stroke color panel
ly.img.stroke.color.picker.opacity Controls the alpha/opacity slider inside the stroke color panel
ly.img.stroke.color.library Controls the swatch library inside the stroke color panel
ly.img.stroke.width Controls stroke width input
ly.img.stroke.style Controls stroke style (dash) selector
ly.img.stroke.position Controls stroke position (inner/center/outer)
ly.img.stroke.cornerGeometry Controls stroke corner join geometry
ly.img.adjustment Controls Adjustments button
ly.img.filter Controls Filter button
ly.img.effect Controls Effect button
ly.img.blur Controls Blur button
ly.img.shadow Controls Shadow button
ly.img.shadow.color Controls shadow color picker
ly.img.shadow.color.picker Controls the color picker inside the shadow color panel
ly.img.shadow.color.picker.opacity Controls the alpha/opacity slider inside the shadow color panel
ly.img.shadow.color.library Controls the swatch library inside the shadow color panel
ly.img.shadow.offset Controls shadow angle and distance
ly.img.shadow.blur Controls shadow blur radius
ly.img.crop Controls Crop button

Shape Options Features#

Feature ID Description
ly.img.shape.options Controls the shape-specific options panel
ly.img.shape.edit Controls the Edit Path button for vector path editing
ly.img.shape.options.cornerRadius Controls corner radius (rect/polygon shapes)
ly.img.shape.options.points Controls star point count
ly.img.shape.options.innerDiameter Controls star inner diameter
ly.img.shape.options.sides Controls polygon side count
ly.img.shape.options.lineWidth Controls the stroke-width input for line graphics (line thickness is sourced from stroke width)

Vector Edit Features#

Feature ID Description
ly.img.vectorEdit Parent key: enables all vector edit child features
ly.img.vectorEdit.moveMode Controls the move/select mode toggle
ly.img.vectorEdit.addMode Controls the add node mode toggle
ly.img.vectorEdit.deleteMode Controls the delete node mode toggle
ly.img.vectorEdit.bendMode Controls the bend mode toggle
ly.img.vectorEdit.mirrorMode Controls the handle mirror mode dropdown
ly.img.vectorEdit.done Controls the exit vector edit button

Transform Features#

Feature ID Description
ly.img.transform Parent key: enables all transform child features
ly.img.transform.position Controls X/Y position controls
ly.img.transform.size Controls width/height controls
ly.img.transform.rotation Controls rotation controls
ly.img.transform.flip Controls flip controls

Page Features#

Feature ID Description
ly.img.page Parent key: enables all page child features
ly.img.page.add Controls Add Page button
ly.img.page.move Controls page move buttons
ly.img.page.resize Controls Resize button
ly.img.page.settings Controls read-only page dimensions, unit and resolution display
ly.img.page.bleedMargin Controls bleed margin settings
ly.img.page.clipContent Controls clip content on/off toggle

Scene Features#

Feature ID Description
ly.img.scene.layout Parent key: enables all scene layout child features
ly.img.scene.layout.horizontal Controls horizontal layout toggle
ly.img.scene.layout.vertical Controls vertical layout toggle
ly.img.scene.layout.free Controls free layout toggle
ly.img.scene.fontSizeUnit Controls visibility of the per-scene font-size unit selector in the page resize panel

Keyboard Shortcut Features#

Feature ID Description
ly.img.keyboard.shortcuts Controls whether registered keyboard shortcuts fire.

Other Features#

Feature ID Description
ly.img.dock Controls visibility of the Dock
ly.img.library.panel Controls Asset Library panel
ly.img.preview Controls Preview button
ly.img.notifications Controls notification toasts
ly.img.notifications.undo Controls undo notifications
ly.img.notifications.redo Controls redo notifications

Troubleshooting#

Feature Not Visible#

If a feature doesn’t appear in the UI after calling enable():

  1. Check if a set() call with a boolean is overriding it. Boolean predicates are terminal and take precedence.
  2. Verify the feature ID spelling matches exactly.
  3. Confirm the feature is relevant for the current context.

disable() Not Working#

If disable() doesn’t hide a feature:

  1. Check if a set() predicate exists for that feature. The set() predicates evaluate before disable().
  2. Use cesdk.feature.get() to inspect the predicate chain.

Glob Pattern Not Matching#

If a glob pattern doesn’t affect expected features:

  1. Verify the pattern syntax is correct.
  2. Use cesdk.feature.list({ matcher: 'your.pattern.*' }) to see which features match.
  3. Check that features are registered before applying the pattern.

API Reference#

Method Signature Purpose
cesdk.feature.enable() enable(featureId: FeatureId | FeatureId[]): void Enable features with default predicates
cesdk.feature.disable() disable(featureId: FeatureId | FeatureId[]): void Disable features
cesdk.feature.set() set(featureId: FeatureId, enabled: boolean | FeaturePredicate): void Set feature state with custom predicates
cesdk.feature.isEnabled() isEnabled(featureId: FeatureId, context?: FeatureContext): boolean Check if feature is enabled
cesdk.feature.list() list(options?: { matcher?: string }): FeatureId[] List registered feature IDs
cesdk.feature.get() get(featureId: FeatureId): FeaturePredicate[] | undefined Get predicate chain for debugging

Next Steps#