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

# Slider

Updated for 3.36.

**It's recommended to first read about the base item before reading about other items** <https://luffyyy.gitbook.io/beardlib/menuui/menuui-item>

## Slider

### Creation

```lua
MyRandomMenu:Slider({
    name = "MySlider",
    text = "Slider of many numbers",
    value = 1,
    min = 0,
    max = 1,
    on_callback = function(item)
        log("Value changed!", tostring(item:Value()))
    end
})
```

### Parameters

| Parameter      | Type    | Description                                                                                                                     |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| value          | Number  | Value of the slider, has to be in range of the set min/max. Defaults to 0                                                       |
| min            | Number  | The minimum value that can be set in the slider. Defaults to `value`'s number                                                   |
| max            | Number  | The maximum value that can be set in the slider. Defaults to `value`'s number                                                   |
| step           | Number  | How much should be added/subtracted to the value every time you increase/decresae the number using wheel control. Defaults to 1 |
| floats         | Number  | How much decimal points does the number allowed to have? Defaults to 3 and can be inherited                                     |
| wheel\_control | Boolean | Should the slider be controlled by the mouse wheel as well? Defaults to false and can be inherited                              |

### Functions

#### Get

| Function | Return Type | Description                            |
| -------- | ----------- | -------------------------------------- |
| Value()  | Number      | Returns the number value of the slider |

#### Set

| Function                                                    | Description                                                                                                                           |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| SetValue(Number value, Boolean run\_callback)               | Sets the value of the item. `value` is the number value and `run_callback` decides whether to run the callback after the value is set |
| SetValueByPercentage(Number percent, Boolean run\_callback) | like `SetValue` but sets using a percentage value                                                                                     |
| SetStep(Number step)                                        | Sets the step value                                                                                                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://luffyyy.gitbook.io/beardlib/menuui/menuui-slider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
