add_interaction
Add a prototype interaction to a Figma node by setting its trigger, action, and optional transition; appends to existing reactions unless replace is true.
Instructions
Add a prototype interaction (trigger + action) to a node. NAVIGATE/SWAP/OVERLAY need a top-level frame on the same page as destination, SCROLL_TO a node inside the same top-level frame, CHANGE_TO a variant of the same component set (source must be an instance or inside a variant). Directional transitions (MOVE_IN, MOVE_OUT, PUSH, SLIDE_IN, SLIDE_OUT) require a direction. Appends to existing reactions unless replace is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to open, required for the URL action | |
| action | No | Action type (default: NAVIGATE) | |
| nodeId | Yes | ID of the node that receives the interaction | |
| replace | No | Replace all existing reactions instead of appending (default: false) | |
| timeout | No | Delay in SECONDS (e.g. 2 = 2s), required for AFTER_TIMEOUT; converted to milliseconds for Figma | |
| trigger | No | Trigger type (default: ON_CLICK) | |
| transition | No | Transition for node actions (default: INSTANT) | |
| openInNewTab | No | Open URL in a new tab (URL action only, default true) | |
| destinationId | No | Destination node ID, required for NAVIGATE, OVERLAY, SWAP, SCROLL_TO and CHANGE_TO | |
| preserveScrollPosition | No | Keep the destination's scroll position (node actions only) |