Skip to main content

reactions

List of Reactions on this node, which includes both the method of interaction with this node in a prototype, and the behavior of that interaction. For help on how to change this value, see Editing Properties.

Signature

reactions: ReadonlyArray<Reaction>

Remarks

Prototyping in Figma lets users create connections between nodes that consist of a trigger (click, hover, etc...) and a corresponding action, such as navigating to another frame. The reactions property lets you read and modify prototyping reactions on the node.

Changing the transition duration in a prototyping action
const node = figma.currentPage.selection[0]
console.log(node.reactions)

/*
Output:

[{
action: {
type: 'NODE',
destinationId: '4:1539',
navigation: 'NAVIGATE',
transition: {
type:'SMART_ANIMATE',
easing: { type: 'EASE_OUT' },
duration: 0.20000000298023224
},
preserveScrollPosition: false
},
trigger: { type: 'ON_CLICK' }
}]
*/

// See clone() implementation from the Editing Properties page
const newReactions = clone(node.reactions)
newReactions[0].action.transition.duration = 0.5
node.reactions = newReactions

On this page