Figma Support Forum

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.

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