Figma Support Forum

Creating an expanding card

Hi, I’m tinkering with how to make an expanding card like you would have in a mobile app. I was able to get the component to expand correctly but what I can’t figure out is how I would overlay the expanded card on top of the other cards?

Any ideas/suggestions would be much appreciated!!

Screen Shot 2021-03-11 at 1.11.52 PM|584x500

Are you working with interactive components or is this just a general question? Just want to make sure this ends up in the right category. :slight_smile:

Yes, interactive components. I assume I probably need to make some kind of nested interaction but I’m not totally sure how that would work.

This an interesting one… What you really are looking for is the option to change the size the component on the “click” event, which if it were in an auto layout with hug contents, would give you the desired results (with clip content on your component of course).

I have been looking for something similar to build collapsing left nav sections where the entire left nav is in an auto layout. It would be possible if the interaction option allowed “Show/Hide” of items within the auto layout on the “click” event for the section title.

There are probably two techniques you have to use here to achieve this use case. The first is to disable clip content to animate the expansion of the card. The second is to do the Auto Layout flip trick to restack the cards so the animation goes above the cards underneath. Here’s a really hacky demo I came up with in a few minutes. Figma

1 Like

Hey, I appreciate your help. I think what you came up with would work but would you mind sharing your full working file? Otherwise I can’t see how you created the interactions.