Inspect

Swap

Swap in SXL Studio: variable/style rebinding for instances and file/page scope migrations.

What Swap does

Swap rebinds variables and styles from one source to another without rebuilding components.

Use it for migration scenarios such as:

  • library -> local token migration;
  • local file -> another local collection/style set;
  • cleanup after copy/paste from external files.

Swap does not change the main component of an instance. For that, use Rebind.

Two swap modes

SXL Studio has two swap workflows in Inspect.

ModeOpen fromBest forScope
SwapMain panel button SwapSelected instance/component-focused remapSingle or All matching instances on current page
Swap libs & variablesLeft tree bottom actionFile/page bulk migration with two-column comparePage or Document

Mode A: Swap (instance-focused)

  1. Select an instance, component, or component set.
  2. Open Inspect and click Swap.
  3. Review detected bindings grouped into Variables and Styles.
  4. Select target collection (for variables) and target styles.
  5. Optional: run Auto-match styles.
  6. Choose scope:
    • Single: current instance only;
    • All: all page instances of the same component key.
  7. Click Apply Swap.

Persistence behavior

Instance-focused Swap stores mapping in diff-id (saveSwapOverride) and registers a watcher. This makes overrides persistent for subsequent matching changes.

Mode B: Swap libs & variables (two-column)

  1. In Inspect left tree, click Swap libs & variables.
  2. Choose data type: Variables or Styles.
  3. Select scope: Page or Document.
  4. Left column: select source bindings (current file + bound external refs).
  5. Right column: choose target library/current file candidates.
  6. Review auto-match results and unmatched rows.
  7. Click Apply Swap.

Status indicators in the left column

  • ok: source is resolvable and valid.
  • ghost: source belongs to an orphan local collection.
  • error: source id cannot be resolved (cannot be applied until fixed).

Important difference vs instance-focused mode

Swap libs & variables applies changes immediately in selected scope, but does not store persistent per-component swap override mapping.

What can be rebound

  • Variables bound to node properties (fill, stroke, radius, spacing, typography fields, etc.).
  • Figma styles: paint, text, effect, grid.

If the file has ghost collections/modes or unresolved bindings:

  1. Run Ghost Heal first.
  2. Re-open Swap and apply mapping.

This reduces red/ghost rows and avoids mapping onto stale sources.

Limitations

  • Swap requires TOKEN_SWAP feature.
  • Matching quality depends on stable naming and available target collections/styles.
  • External library visibility depends on Figma permissions and published assets.