Skip to main content

Overview

Extracts all override properties from a component instance. These overrides can later be applied to other instances using set_instance_overrides, enabling efficient propagation of customizations across multiple instances.
This is part of the Instance Override Propagation workflow contributed by @dusskapark. See the demo video.

Parameters

nodeId
string
ID of the component instance to get overrides from. If not provided, the currently selected instance will be used.

Response

success
boolean
Whether the operation succeeded
message
string
Success or error message describing the result
sourceInstanceId
string
ID of the instance that overrides were extracted from
mainComponentId
string
ID of the main component the instance is based on
overridesCount
number
Number of override properties that were extracted

Usage Example

// Get overrides from a specific instance
const result = await get_instance_overrides({
  nodeId: "123:456"
});

console.log(result);
// {
//   "success": true,
//   "message": "Successfully copied 5 overrides from instance",
//   "sourceInstanceId": "123:456",
//   "mainComponentId": "789:012",
//   "overridesCount": 5
// }

// Or use currently selected instance
const selectedResult = await get_instance_overrides({});

Instance Override Workflow

1

Select or identify source instance

Choose the component instance that has the customizations you want to propagate
2

Extract overrides

Call get_instance_overrides to capture all override properties from the source
3

Identify target instances

Get the node IDs of instances you want to apply the overrides to
4

Apply overrides

Use set_instance_overrides to propagate the customizations

What Gets Captured

The tool captures all override properties including:
  • Text content overrides
  • Visibility toggles for nested layers
  • Component swap overrides
  • Fill and stroke color overrides
  • Any other property that can be overridden in a component instance

Common Use Cases

Design System Updates

Apply consistent customizations across multiple component instances

Template Duplication

Replicate a customized instance’s settings to create variations

Bulk Modifications

Make the same changes to multiple instances without manual repetition

State Management

Copy state configurations (like button states) between instances

Example: Propagating Button Styles

// Step 1: Get overrides from a customized button instance
const sourceOverrides = await get_instance_overrides({
  nodeId: "source-button-id"
});

if (sourceOverrides.success) {
  console.log(`Captured ${sourceOverrides.overridesCount} overrides`);
  
  // Step 2: Apply to multiple target buttons
  const targetButtons = ["button-1", "button-2", "button-3"];
  
  const applyResult = await set_instance_overrides({
    sourceInstanceId: sourceOverrides.sourceInstanceId,
    targetNodeIds: targetButtons
  });
  
  console.log(`Applied overrides to ${applyResult.results.length} buttons`);
}

Notes

  • Overrides are stored temporarily in the plugin’s memory until applied
  • Only works with component instances (not main components)
  • The source instance must have at least one override property
  • Overrides are extracted from the current state of the instance

Error Handling

const result = await get_instance_overrides({ nodeId: "123:456" });

if (!result.success) {
  console.error(result.message);
  // Possible errors:
  // - "No instance selected"
  // - "Selected node is not a component instance"
  // - "Instance has no overrides to copy"
}

Build docs developers (and LLMs) love