Visible
The visible key in an object's properties can be set using a logical expression that evaluates to true or false. This determines whether a specific UI element is shown or hidden based on the conditions specified in the expression. Works in the same way as enabled.
Boolean Logic: Use logical operators (
&&,||) to combine multiple conditions.Comparison Operators: Use
==,!=,>,<,>=,<=to compare values.Regex Match: Use
matchesto perform a regex comparison.
Examples
Complex Condition
"visible": "(heroStyle == 'image' || heroStyle == 'video') && showOverlay == true"This makes the property visible only when a hero background is set and the overlay is enabled.
Visibility Based on Numeric Ranges
"visible": "overlayOpacity > 20 && overlayOpacity < 80"Useful for showing fine-tuning controls only when the opacity is in a middle range.
Negation to Hide Elements
"visible": "showBadge != true"The property is visible when
showBadgeisfalse.Match a regex
"visible": "couponCode matches /^SAVE[0-9]{2}$/"The property is visible when
couponCodelooks likeSAVE10orSAVE25.
The following example toggles visibility based on a switch and a regex match.
Last updated
Was this helpful?

