> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infilsense.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sliders

> Create numeric or boolean sliders with snapping, persistence, and Quick Commands.

Sliders update while dragging and snap numeric values to `Step`. They register with Quick Commands automatically.

## Numeric slider

```lua theme={null}
tab:AddSlider({
	Info = {
		Title = "WalkSpeed",
		Description = "Adjust character movement speed.",
	},
	InternalInfo = {
		UniqueCommandId = "walkspeed",
		Aliases = { "ws", "speed" },
	},
	Min = 16,
	Max = 250,
	Default = 16,
	Step = 1,
	Save = true,
	Callback = function(value)
		print("WalkSpeed:", value)
	end,
})
```

## Boolean slider

Use `SliderType = "bool"`:

```lua theme={null}
tab:AddSlider({
	Info = { Title = "Mute Audio" },
	InternalInfo = { UniqueCommandId = "mute_audio" },
	SliderType = "bool",
	Default = false,
	Callback = function(value)
		local muted = value == 1
		print("Muted:", muted)
	end,
})
```

The boolean implementation stores `0` and `1`, and displays **Off** / **On**.

## Rich text

Slider labels and description tooltips support Roblox rich-text markup by default:

```lua theme={null}
tab:AddSlider({
	Info = {
		Title = "<b>WalkSpeed</b>",
		Description = "<font color=\"#9D7BFF\">Adjust movement speed.</font>",
	},
	Min = 16,
	Max = 250,
})
```

Set `RichText = false` on the slider config or inside `Info` to opt out.

## Configuration

**Info.Title** `string` (default: "Slider")

Slider label.

**Info.Description** `string`

Tooltip text shown instantly while hovering the slider row. Use `\n` for line breaks.

**RichText** `boolean` (default: true)

Enables rich-text markup for the slider label and description tooltip. Set to `false`
to opt out. `Info.RichText` is also accepted.

**Min** `number` (default: 0)

Numeric minimum. Boolean sliders override this to `0`.

**Max** `number` (default: 100)

Numeric maximum. Boolean sliders override this to `1`.

**Default** `number | boolean`

Initial value. Numeric sliders default to `Min`. Boolean defaults normalize to `0` or `1`.

**Step** `number` (default: 1)

Numeric snap interval. Boolean sliders force `Step = 1`.

**SliderType** `"number" | "bool"` (default: "number")

Selects numeric or boolean behavior.

**Save** `boolean` (default: false)

Persists the slider value under `Settings[commandId]`. `InternalInfo.Save = true` and `Settings.save = true` on the component config are also accepted.

**InternalInfo.UniqueCommandId** `string`

Stable Quick Commands and persistence ID.

**InternalInfo.Bindable** `boolean` (default: false)

Adds a right-click keybind menu. In the current implementation, a bindable **boolean** slider can toggle through its keybind callback. A numeric slider exposes the binding UI but does not use the assigned keybind to set a numeric value.

**InternalInfo.StartupAvailable** `boolean` (default: false)

Adds a persisted startup flag to the right-click menu. The slider itself is not automatically executed from that flag during initialization.

**Aliases** `string[]`

Alternate Quick Commands names. `Info.Aliases` and `InternalInfo.Aliases` are also recognized.

**Callback** `function`

Receives the current stored slider value. Numeric sliders pass a number; boolean sliders pass `0` or `1`.

## Persistence

When `Save` is enabled, the library loads a previously saved value before using `Default`:

```lua theme={null}
tab:AddSlider({
	Info = { Title = "Field of View" },
	InternalInfo = {
		UniqueCommandId = "camera_fov",
	},
	Min = 70,
	Max = 120,
	Default = 90,
	Save = true,
})
```

The saved value is stored in:

```text theme={null}
Settings["camera_fov"]
```

## Quick Commands

Numeric sliders accept one numeric argument:

```text theme={null}
ws 120
```

Boolean sliders accept `on`, `off`, `true`, `false`, `1`, or `0`:

```text theme={null}
mute on
mute off
```

With no argument, a numeric slider reapplies its current value and a boolean slider toggles its current state.

## Returned handle

```lua theme={null}
local slider = tab:AddSlider({
	Info = { Title = "Field of View" },
	Min = 70,
	Max = 120,
	Default = 90,
})

print(slider:getId())
print(slider:getValue())
slider:setValue(100)
```

| Method | Behavior |
| :- | :- |
| `getValue()` | Returns the stored numeric value or boolean-slider `0`/`1`. |
| `getId()` | Returns the resolved command ID. |
| `setValue(value)` | Clamps/snaps the value, updates the visuals, fires the callback, and saves when persistence is enabled. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.