Categories of Traits
Experro-Storefront provides you with two categories of traits: 1. Default traits 2. Customizable traitsCategory 1 - Default traits
Default traits are the simplest and most straightforward method to generate the sidebar of the Visual Builder for a specific component. Experro-Storefront offers a wide range of default traits. As follows:- TEXT The text trait is utilized to render a textbox on the sidebar of the Visual Builder. This trait allows you to access the value entered in the textbox as a prop within your component.
To access the value of the trait within the component, it is essential to pass the name attribute in the widget’s attributes. Failure to include the name attribute will result in the inability to retrieve the trait’s value in the component.
- NUMBER The number trait is utilized to render a number input on the sidebar of the Visual Builder.
- CHECKBOX The checkbox trait is used to render a checkbox on the sidebar of the Visual Builder.
- SELECT The checkbox trait is used to render a drop down on the sidebar of the Visual Builder.
Category 2 - Customizable traits
Customizable traits share similarities with default traits but provide additional features and functionalities. The implementation process for customizable traits is a bit different. Customizable traits inherit all the types from default traits and include the following additional types.- TEXT The Customizable text trait is the same as the default trait text, but with some additional features. We will disclose those features further in this section.
- TEXT AREA The TEXT AREA trait works the same as the TEXT trait; the only difference is that it renders a text area.
- CHECKBOX The CHECKBOX trait is used to render a checkbox on the sidebar of the UI builder.
- COLOR PICKER The Color picker trait is used to add a color picker to the sidebar of the UI builder.
- DROPDOWN This trait is used to render a dropdown on the side bar of the UI builder.
- DATA SOURCE DROPDOWN If you want to integrate data support from both the Content Library and Free form into your component, then you can use the data source dropdown trait.
- Free From
- Content Library
internalName property for this trait. You can access the value from this trait using the fixed key dataSource.
- CONTENT MODEL POPUP
If you want to use or integrate data from the contentLibrary, the
CONTENT MODAL POPUPtrait is required to display the list of records on the sidebar of the UI builder for that component.
modelInternName of the component in its config, as shown in the above code snippet.
- IMAGE SELECTOR The IMAGE SELECTOR trait is used to add an image selector to the sidebar of the UI builder.
dependent in the traitConfig. In the dependent property, you can see that the internalName of the above object is given. This means that the description text trait will only be rendered when there is a value in title text.
descriptionText trait is dependent on titleText and will only render when the value of titleText is exactly the same as the value specified in the subDependency flag.