Expressions
Expressions are a powerful way to declare relationships and connections in your user interface. They´re typically used to combine basic arithmetic with access to properties of other elements. When these properties change, the expression is automatically re-evaluated and a new value is assigned to the property the expression is associated with:
When my-property
changes, the width changes automatically, too.
Arithmetic in expression with numbers works like in most programming languages with the operators *
, +
, -
, /
:
Concatenate strings with +
.
The operators &&
and ||
express logical and and or between
boolean values. The operators ==
, !=
, >
, <
, >=
and <=
compare
values of the same type.
Access an element’s properties by using its name, followed by a
.
and the property name:
The ternary operator ... ? ... : ...
is also supported, like in C or JavaScript:
Statements
Assignment:
Self-assignment with +=
-=
*=
/=
Calling a callback
Conditional statements
Empty expression
© 2024 SixtyFPS GmbH