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

# Slider

> Create slider input components in Gradio

The Slider component creates a slider for selecting numeric values within a range.

## Basic usage

```python theme={null}
import gradio as gr

def adjust_brightness(value):
    return f"Brightness: {value}%"

gr.Interface(
    fn=adjust_brightness,
    inputs=gr.Slider(0, 100),
    outputs=gr.Textbox()
).launch()
```

## Constructor

<ParamField path="minimum" type="float" default="0">
  Minimum slider value
</ParamField>

<ParamField path="maximum" type="float" default="100">
  Maximum slider value
</ParamField>

<ParamField path="value" type="float | Callable | None" default="None">
  Default value for slider
</ParamField>

<ParamField path="step" type="float | None" default="None">
  Increment between slider values. If None, auto-calculated
</ParamField>

<ParamField path="precision" type="int | None" default="None">
  Precision for rounding. If 0, converts to int
</ParamField>

<ParamField path="label" type="str | None" default="None">
  Label displayed above the component
</ParamField>

<ParamField path="randomize" type="bool" default="False">
  If True, value is randomly set within range on load
</ParamField>

<ParamField path="buttons" type="list[Literal['reset']] | None" default="None">
  Buttons to show. Options: `"reset"` to reset to default value
</ParamField>

## Events

* **change** - Triggered when value changes
* **input** - Triggered while dragging slider
* **release** - Triggered when slider is released

## Examples

### Integer slider

```python theme={null}
import gradio as gr

gr.Slider(
    minimum=1,
    maximum=10,
    step=1,
    value=5,
    label="Select a number"
)
```

### With custom step

```python theme={null}
import gradio as gr

gr.Slider(
    minimum=0,
    maximum=1,
    step=0.1,
    value=0.5,
    label="Confidence threshold"
)
```


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