Skip to main content
Question

Editable content of components

  • August 14, 2021
  • 4 replies
  • 3072 views

Patryk_Piorkowski

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.

This topic has been closed for replies.

4 replies

Brian_Saunders

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.


Patryk_Piorkowski

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.


Pepa_Linha
  • New Participant
  • 3 replies
  • August 18, 2021

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 🙂


  • 0 replies
  • September 17, 2021

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


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