Dynamic Classes in pluggable widgets

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!
1 answers

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>
    <returnType type="String" />

In the Render function:

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