1. A method comprising: by a computing device, executing, by a main thread, instructions to: generate a GUI hierarchy comprising a representation of a graphical user interface (GUI), wherein each layer of the GUI is represented by a node in the GUI hierarchy, wherein each layer of the GUI represents a logical grouping of components of the GUI, wherein at least one of the layers in the GUI comprises an animated component associated with a module specifying animation behavior for the animated component, and wherein the node in the GUI hierarchy representing the at least one layer is associated with a set of state variables for the animated component; and provide copies of the GUI hierarchy to an input thread and a graphics thread; by the computing device, asynchronously executing, by the input thread, instructions to: initialize, using the module, the state variables based on a triggering condition for animation of the animated component; and provide information about the initialized state variables to the graphics thread; and by the computing device, asynchronously executing, by the graphics thread, instructions to update the at least one layer of the GUI by rendering, using the module, a first frame of the animation based on the state variables.