# Chapter 13: The Slider Element

The `Slider` struct represents a slider UI element. It has a background rectangle, a slider rectangle, two colors for the background and the slider, a callback that is triggered when the value changes, and the current value of the slider.

The `render` method is responsible for drawing the slider onto the screen, while the `handle_mouse_click` method moves the slider to the x-coordinate of a mouse click. The `update_value` method calculates the current value of the slider based on the position of the slider rectangle and triggers the `on_value_changed_callback`.

This way, by managing these GUI elements, we can create a variety of user interfaces for various applications.


---

# 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-13-the-slider-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.
