# Life Cycle

A component represents an object or content in the game such as screens, menus and all other visual or structural elements.

### Mounting Cycle

The life cycle of an component follows the Mounting cycle for actions.

The mounting cycle has 3 steps:

1. Setup - Here the action needs to set up everything it will need for working generally, in this section a component will generally add its HTML content to the global Monogatari object and will set up any needed configuration or state variables.
2. Bind - Once the component has been setup, its time to bind all the necessary event listeners or perfom more operations on the DOM once all elements have been setup. Components will generally bind all the listeners needed for their inner elements to work correctly.
3. Init - Finally, once the component was setup and it performed all the needed bindings, it may start performing its operations and perform all further needed operations.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.monogatari.io/documentation/develop/building-blocks/components/life-cycle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
