States
The states
statement allows to declare states and set properties of multiple elements in one go:
In this example, the active
and active-hovered
states are defined depending on the value of the active
boolean property and the TouchArea
’s has-hover
. When the user hovers the example with the mouse, it will toggle between a blue and a green background,
and adjust the text label accordingly. Clicking toggles the active
property and thus enters the inactive
state.
Transitions
Transitions bind animations to state changes.
This example defines two transitions. First the out
keyword is used to animate
all properties for 800ms when leaving the disabled
state. The second
transition uses the in
keyword to animate the background when transitioning
into the down
state.
© 2024 SixtyFPS GmbH