Components with auto-layout

Is it possible to make components with auto layou. E.g. I’m making form container with auto-layout enabled and wherever I’m using it, I can drop different components (fields and buttons) inside it.

1 Like

You can add any objects only to the master component. It is not possible to add or remove objects to instances of this component.

There’s a sort of hacky way to go about this. You can create a main component called Placeholder, and then another main component (let’s call it Container) with Auto Layout that wraps multiple Placeholders.

This way, any time you create an instance of Container, you can replace the nested Placeholders that you want to have visible for that instance, with any other component you want from within the tools in the Inspector.

Does that make sense?

@javieralaves

When you say “replace”, do you mean delete the placeholder and add something in its place? And if so, how does that help?

Asking because I can’t seem to find a “replace” command.

Luis from Figma recently recorded a video on YouTube that explains this method. I hope it helps!

Thanks @javieralaves ! Yea, I noticed that video on YT lately. And I fully agree with that hacky part. Hopefully one day Figma will solve it in more elegant way :slight_smile:

1 Like

+1 here; auto layout and components are both awesome individually, but they only fully make sense if they work together. Not being able, for example, to drop another item into an instance of a list is a real blocker to realising their full combined potential.

1 Like