Dynamic Classes in pluggable widgets

0
Hello, We have built several pluggable widgets for our mobile app and are looking to style them in a certain way. However, we have discovered that the 'Dynamic Class' doesn't seem to work with these widgets. We haven't found any documentation about using dynamic classes within a pluggable widget. Is there any type of customization we can do to make that functionality work? Thanks!
asked
1 answers
0

Hi Steve,

You can add an Expression type field in the .xml file, then you can add dynamic classes to that expression. You can then use that in the widget props to set the class on the rendered output of the widget.

 

<property key="dynamicClasses" type="expression" defaultValue="" required="true">
    <caption>Dynamic classes</caption>
    <description></description>
    <returnType type="String" />
</property>

In the Render function:

return <div class={dynamicClasses}></div>;

 

answered