Skip to main content

Within a component, can a layer share both a a text and boolean property?


Ed_Gonzalez

With the changes to component building, I have some instances where I have an editable text layer that also has the option to be hidden, depending on the context. I know the solution would be to create a variant, but given we have boolean properties, can that layer share both a boolean property and text property? Right now I have to label the same layer differently for both properties. Here’s the component I’m working with:

This topic has been closed for comments

7 replies

Klesus
  • 237 replies
  • May 19, 2022

Select the text and add a boolean property from the Layer section.
image


Ed_Gonzalez

@Klesus Yes, that’s what I’ve done. But the issue, as I captured in the screenshot, is that it forces me to name the property something else (clients for the text property, clients2 for the boolean). I want the “clients” property to share the same name and property.


Klesus
  • 237 replies
  • May 19, 2022

Alright I’ve misunderstood, and I don’t know why you’d want that but anyways…
When I try that myself it works even though I get warnings:
image
But it still works
image
Maybe it won’t work if I restart or something, but are you saying you can’t do this?


Ed_Gonzalez

Well, I want that because of the use case of this component and the context it’s being used. There are instances where that specific content won’t show and others where they would. In the context that it does show, it needs to have different content within it as it’s a list.

No, I can’t do this. With the warning, it’s not letting me.


Klesus
  • 237 replies
  • May 20, 2022

You don’t need properties with the same name for that though. So I’m still confused as to why that’s important?


Ed_Gonzalez

In my example, the name of that layer is clients. So the property should be named clients. Because the text should only be clients. And the Boolean property would also be named clients. It’s for our own organization within the design system.


  • 0 replies
  • August 18, 2022

This topic was automatically closed 90 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