> For the complete documentation index, see [llms.txt](https://idontgiveaf.gitbook.io/fluent/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://idontgiveaf.gitbook.io/fluent/elements/guide/sliders.md).

# Sliders

I might fix how slider's hitbox is so small.

To create a slider, use this.

```lua
local Slider = Tabs.Main:AddSlider("Slider", 
{
    Title = "Slider",
    Description = "This is a slider",
    Default = 2,
    Min = 0,
    Max = 5,
    Rounding = 1,
    Callback = function(Value)
        print("Slider was changed:", Value)
    end
})
```

{% hint style="warning" %}
If you are having issues, you're supposed to replace "Tabs.Main" with your actual tab.&#x20;

Example: "Tabs.Exploits"&#x20;

Whatever you put in your [Tabs](/fluent/components/window/tabs.md) variable, it's what you need.
{% endhint %}

Change `local Slider` to a different variable name every time. It can be anything.

`Slider` (name of slider) is saved in the Options variable.

You can try to remove it, but I've never tried to.

You can get the value anywhere simply by using this: (Put your variable name)

```lua
Slider.Value
```

Or, whatever you put as the name of the toggle.

```lua
Options.Slider.Value
```

### Functions

You can check when the slider is changed, but Callback does the same thing.

```lua
Slider:OnChanged(function(Value)
    print("Slider changed:", Value)
end)
```

To set the value of a slider, use this.

```lua
Slider:SetValue(3)
```

{% hint style="warning" %}
If you don't set the right variable name, it won't work.
{% endhint %}
