# Chapter 10: The Button Element

The `Button` struct is one of our basic UI elements. It has an associated text box for displaying text, a color for the background, and a callback that is invoked when the button is clicked.

We provide a `render` method to draw the button onto the screen, an `is_pressed` method to check whether a button was clicked based on the x and y coordinates of a mouse click, and an `on_click` method to execute the button's callback function.

Moreover, we have serialization logic implemented for the `Button` and its inner components: `RcTextBoxWrapper`, `ColorWrapper`, and `RectWrapper`. This allows us to convert a `Button` to a serialized form for storage or network communication.


---

# 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://lados-organization.gitbook.io/goku/chapter-10-the-button-element.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.
