Skip to main content
Question

Component using text styles as component property

  • November 25, 2024
  • 1 reply
  • 92 views

IanStewart

Hi all,

I was wondering if it is possible to create a component that has some text that should be one of the defined text styles. I would like to have the text be a property of that component just like for example you can have an instance swap property to swap out icons.

I know I could just make a bunch of variants with all the text styles but that seems a bit cumbersome. Especially if for example you have 14 text styles groups with say 4 styles per group.

1 reply

ericmmartin
  • New Member
  • 1 reply
  • March 18, 2025

It sounds like you’ve already set up text styles. Can users not just apply these? Is there a reason to add another layer of selections? 

 

If this is really necessary, you could create subcomponents, one for each group. Each would have the 4 styles. Bring those subcomponents into your parent component and apply an instance swap and define the subcomponents as preferred. Name them well, and it would be as you describe. Make sure the nested properties are active on the parent for extra ease-of-use.

 

It would still be cumbersome for you to set up, but would be easier to select from the component.


Reply


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