Swap text in variants to reflect action

Hello,

I am designing a food delivery app. One of its functions is being able to click on the x on a restaurant card which causes that card to change into “restaurant x hidden. undo?”. I managed to do this, but now I’d like to be able to somehow make the name of each restaurant appear in that box.
image

Is this possible?
Thank you.

Yes, that’s possible by using variables and advanced prototyping.

Checkout this official training file by Figma:

There are also plenty of videos about variables and prototypes.

Good luck