Skip to main content
Question

How would one create a collapsable FAQ module?


Nikolai_the_3rd

I would love to create a collapsable FAQ accordeon.

What I’ve tried
I’ve created 2 variants (open and closed question). Then I combined an instance of that interactive component into another component with smart layout, combining multiple instances into a list.

The result + problem
It folds open successfully but the second / other questions / rest of the page sections don’t move down to make space for it.

Bonus question
As a bonus question I’d like to make it so that only 1 question is in the open state at the same time.

This topic has been closed for comments

Peter_Garber

I think you may be able to achieve this with Auto Layout if you can add Auto-Layout to two variants


Peter_Garber

But the problem is, you can’t do that as of now.


tank666

You need to create as many options as there are question items. Where one item is open and all the others are closed.


Thom_van_der_Doef

@tank666 I’m looking to do just that: make a component with a collapsed and an expanded state that pushes or pulls other elements up or down. Is this currently possible in the beta?


tank666
  • September 15, 2021

Hi @Thom_van_der_Doef, currently, when playing a prototype (Presentation mode) it doesn’t work properly yet.


Mehul_Sonagara

You can do it by applying auto layout and set height to hug content


Gwen_PETITEAU

@tank666 Just like Thom_van_der_Doef, I’m currently trying to make a component with a collapsed and an expanded state that pushes or pulls other elements up or down, with smart animate and autolayout. It does seems to work when I have one element alone, but as soon I’m trying to use many of them with autolayout, only the last one has the desired behaviour. It seems that for all the others, when the expanded content appears, instead of pushing others elements below, it just appears behind it. Is the expected behaviour currently possible in Figma ? Or I have done something wrong ?


tank666
  • January 4, 2022

Hi @Gwen_PETITEAU, it’s hard to say something without seeing how your file works. When Interactive Components came out of beta, they began to support Auto Layout. I made an example for you, which you can see here:

Figma – 4 Jan 22

Gwen_PETITEAU

Hi @tank666, thanks for the prototype, it’s exactly what I’m looking for ! Is it possible to have access to the file with the layers and prototype interactions to see how it works ? It seems that I can access the prototype only.
Thanks for your help !


tank666
  • January 4, 2022

Click on the chevron next to the file name and select “Open in editor”. You can then duplicate the file to be editable.


jsimon
  • July 21, 2023

One small thing that solved this for me was to uncheck the “clip content” box when using autolayout. Banged my head against the wall for a good hour before figuring that out.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings