Interactivity transforms your toddle project from a static website to a full-scale dynamic web app. The click of a button, a modified attribute, or an API response should give the user feedback.
Reacting to user events is the most common form of interaction. You can set these up on all elements.
There are a few special events on the top level of each of your components:
Declaring and emitting events from your components is crucial in building highly dynamic and scalable applications.
Events are the unidirectional flow of data from child components to their ancestors. Events always bubble upwards. Parent components can communicate with their children by setting down their attributes for flowing data.
Read much more about declaring custom events on components.
Listening to events is not much fun without them causing some action. In toddle, you can set up workflows in response to an event. A workflow consists of a graph of actions. An action could be to `Set variable`, `Log to console`, or `Navigate to URL`. See the complete overview here.
Actions are unpure functions that usually mutate persistent data or have a side-effect.