Figma Support Forum

Editable content of components

There is any option to change the content of component? For example I have Alert component with icon and some text. And I want to use this component in different way: I want to add button under the text. Could be great to have option like “Mark this layer as a editable container.”. After that could be possible to drag and drop button or other element in that container. I know about detach instance option, but if I make changes to master component, detached instace don’t update.

1 Like

Hi, a couple ways to do this.

  1. Make an auto-layout component with the button in it, and toggle the visibility of the button on or off depending on which version you want to use. With auto layout, the alert component will adapt automatically.

  2. Use variants. Create a version of the alert component with the button, and a version without the button, select both components, and click “Combine as variants”.

I would do the variants approach, personally. Lmk if you have any questions about this.

Hi, thanks for reply. I forgot to mention about using variants in this case. I would like to give an other example. So, I have modal component and I want to create couple of views with that modal, but different content, for example forms. Suppose that I don’t know how many forms I have to handle in my project. Creating different variants for this purpose would be pretty annoying. So the option what I mention before - editable content in component, would be great.

1 Like

I solve this problem too. It would be great allow to add “slot” / “editable container” to component and then put some other components there.

It is not possible use variants, because I don’t know what content will be inside (for example modals as @Patryk_Piorkowski mentioned)

I really need this too :slight_smile:

1 Like

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