Why can't I link a prop to the Content of a text element

Hello guys, I have a question… why can’t I link a prop to the “Content” of a text component?

For that, please create a slot instead (right-click the text element on the canvas and create a slot)

@theoretical_pig I just finished their tutorial course - Plasmic does a great job going over main features, highly recommend it!

@basic_smelt Gabriele and I have been Plasmic users and fans for a while. We’re just going locos attempting to localize a project and pick up all the translation keys, so we’re experimenting with new possible workflows.

I think the main question is regarding linking the prop. It also came to my mind a week ago when I was working on a specific task. It helps when you only want to have a text component with it’s content to be controlled from parent component.
While converting it to slot creates a separate text component on the consumer side

Similar Examples with other elements

  1. img: We can simply link the src prop. We don’t have to convert the image to slot to provide the src prop from the parent component
  2. a: Anchor tag destination can be link to it’s parent as well.
    Similarly, it’s not possible at the moment to link a prop to content field of a text component. Is there any specific reason to restrict it on content field of text component?

@zonal_mammal Can you elaborate a bit more on what you’re looking for? (You probably know this already but currently you can already control the styles on text slots from the component.)

@yang I would like to control only content text without impacting styling of the element.

With slots is often happening that the entire element is converted to the slot, meanwhile I need only its text content to be overwritten. Currently using overrides for this, but in my mind props and slots are cleaner to implement.

@yang I hope this conveys the flow which require linking the content prop.

@theoretical_pig Text slots actually do let you only set the text without impacting styling. You set styles on the slot, and they affect the text contents passed in. The text contents only override the slot styles if you explicitly set them on the text contents.

@zonal_mammal Got it, if I were to summarize - in this case it’s about having flexibility to pipe one input string to multiple locations

Yup Exactly!

I can even pass on the imageUrl to the link element destination prop.