Flexible Auto layout component (accordion)

Hello people!

I want to create a component, to which I can freely add varied content. For example, an accordion, without having to define all content variants in advance. Is it possible? I want to be able to use components inside this component and have it auto-scale.

Let me try to explain in more details:

I have an accordion component, which has different states. Open/Closed etc…

The variants uses auto-layout, and the width and height is set to “hug” contents.

When using my component, I can not paste anything new inside. I have to detach it:

What I would like, is to replace that grey rectangle with anything else. Sometimes another component, sometimes it may be just text.

Is it a way to make my component flexible in this way? Is it strictly not allowing me to put other stuff inside my component on purpose?

Is it a workaround for this, or is it “bad practice”?

I would find it very useful.

Watch the following videos about the “slot” method.

1 Like

Thank you very much! This was exactly what I was looking for :grinning:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.