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.
| Mode | Open from | Best for | Scope |
|---|---|---|---|
| Swap | Main panel button Swap | Selected instance/component-focused remap | Single or All matching instances on current page |
| Swap libs & variables | Left tree bottom action | File/page bulk migration with two-column compare | Page or Document |
Mode A: Swap (instance-focused)
- Select an instance, component, or component set.
- Open Inspect and click Swap.
- Review detected bindings grouped into
VariablesandStyles. - Select target collection (for variables) and target styles.
- Optional: run Auto-match styles.
- Choose scope:
Single: current instance only;All: all page instances of the same component key.
- 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)
- In Inspect left tree, click Swap libs & variables.
- Choose data type:
VariablesorStyles. - Select scope:
PageorDocument. - Left column: select source bindings (current file + bound external refs).
- Right column: choose target library/current file candidates.
- Review auto-match results and unmatched rows.
- 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.
Recommended order with Ghost Heal
If the file has ghost collections/modes or unresolved bindings:
- Run Ghost Heal first.
- Re-open Swap and apply mapping.
This reduces red/ghost rows and avoids mapping onto stale sources.
Limitations
- Swap requires
TOKEN_SWAPfeature. - Matching quality depends on stable naming and available target collections/styles.
- External library visibility depends on Figma permissions and published assets.