Visible
Last updated
Was this helpful?
Last updated
Was this helpful?
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 .
Boolean Logic: Use logical operators (&&
, ||
) to combine multiple conditions.
Comparison Operators: Use ==
, !=
, >
, <
, >=
, <=
to compare values.
Regex Match: Use matches
to perform a regex comparison.
Complex Condition
This makes the property visible only if the backgroundType is either custom' or 'image', and the textColor is 'white'.
Visibility Based on Numeric Ranges
Useful for showing elements that should only be visible within a specific range, e.g., showing a message if the opacity is not between 20-30.
Negation to Hide Elements
The property is visible when mySwitchControl
is false
.
Match a regex
The property is visible when name
contains rapid
or weaver
or elements
.
The following example code toggles the visibility of controls based on the value of the switch.