> For the complete documentation index, see [llms.txt](https://lados-organization.gitbook.io/goku/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lados-organization.gitbook.io/goku/chapter-13-the-slider-element.md).

# 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.
