> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/createslider.md).

# createSlider()

### Example

<figure><img src="/files/GZFY2eOefdNXivSQDBbH" alt=""><figcaption></figcaption></figure>

```python
def setup():
  global slider1,slider2,slider3
  slider1 = createSlider(0, 255,1)
  slider1.position(50,40)
  slider2 = createSlider(0,255,1)
  slider2.position(50,60)
  slider3 = createSlider(0,255,1)
  slider3.position(50,80)
  
def draw():
  global slider1,slider2,slider3
  fill(slider1.value(),slider2.value(),slider3.value())
  circle(200,200,200)
```

### Syntax

```
createSlider(minimum, maximum, [initial_value], [step])
```

<table><thead><tr><th width="210">Input</th><th>Description</th></tr></thead><tbody><tr><td>minimum</td><td>minimum value of the slider</td></tr><tr><td>maximum</td><td>maximum value of the slider</td></tr><tr><td>initial_value(optional)</td><td>initial value of the slider</td></tr><tr><td>step(optional)</td><td>step size between values on the slider.</td></tr></tbody></table>

### Description

`createSlider()` function can be used to create a slider control . A slider control is a **graphical user interface element** that **allows the user to select a value** within a specified range **by dragging a handle along a track.**

To draw the slider control on the canvas, you can use the `draw()` function and the `value()` method of the slider object

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}


---

# 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://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/createslider.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.
