A state machine describes a system by its states, the transitions between them and the conditions that trigger each transition. One with a fixed number of states is called a finite-state machine, and the model is widely used in computer science, software design, communication protocols and game development.
In user interfaces and animation, a state machine defines the states an element can be in, such as idle, hovered or pressed, and which animation plays as input moves it from one state to another.