---
title: Sliders, toggles, and dropdowns
product: Unity Spark
canonical: https://docs.unity.com/en-us/unity-spark/create/build/ui-editor/elements/sliders-toggles-dropdowns
last_updated: 2026-12-01
generated_at: 2026-12-01T21:21:24.994Z
locale: en-us
---

# Sliders, toggles, and dropdowns

> Let players choose a value with a slider, turn an option on or off with a toggle, or pick from a list with a dropdown in your Unity Spark UI.

Sliders, toggles, and dropdowns let players change settings, such as volume, music on or off, or difficulty. For more information about choosing an element, refer to [Choose an element](/unity-spark/create/build/ui-editor/elements/about-ui-elements.md#choose-an-element).

These elements change a value when the player uses them, but your game decides what the value does. To connect a control to your game, ask the [AI assistant](/unity-spark/create/assistant/about-assistant.md), for example, `Make the volume slider change the music volume.` You can also use a script.

## Settings every control shares

Buttons, sliders, toggles, input fields, and scrollbars share the following settings.

| **Setting**      | **Description**                                                                                                                                                                                                                                                     |
| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Interactable** | Sets whether the player can use the control. When **Interactable** is disabled, the control shows its **Disabled Color**.                                                                                                                                           |
| **Colors**       | Sets the tint for each state: **Normal Color**, **Highlighted Color** (when the pointer is over it), **Pressed Color**, **Selected Color**, and **Disabled Color**. **Color Multiplier** brightens every state, and **Fade Duration** sets how long a change takes. |

## Slider

A slider is a handle that the player drags along a track to choose a value between a minimum and a maximum. A new slider has a track, a fill that grows as the value increases, and a handle. It has no label, so add a **Text** element next to it.

### Slider properties

The **Slider** [component](/unity-spark/create/build/components/about-components.md) contains the following main settings.

| **Setting**                     | **Description**                                                                 |
| :------------------------------ | :------------------------------------------------------------------------------ |
| **Direction**                   | Sets which way the value increases, for example, from left to right.            |
| **Min Value** and **Max Value** | Sets the range of values. By default, `0` to `1`.                               |
| **Whole Numbers**               | Allows only whole numbers, for example, for a difficulty level from `1` to `5`. |
| **Value**                       | Sets the current value.                                                         |

To respond when the player drags the slider, pass a function to `OnValueChanged`. The function receives the new value.

```lua
local function onVolumeChanged(value)
  -- use the new value, for example to set the music volume
end

volumeSlider:OnValueChanged(onVolumeChanged)
```

Pass a function that you define in the same script. Don't pass `self`, because the event calls the function you give it.

To change the value from a script without triggering `OnValueChanged`, use `SetValueWithoutNotify`. Don't use a slider only to display a value, because the player can drag it. Use a [progress bar](/unity-spark/create/build/ui-editor/elements/progress-bars.md) instead.

## Toggle

A toggle is a checkbox with a label that the player turns on or off. A new toggle shows the label `Toggle` and starts turned on.

### Toggle properties

The **Toggle** component contains the following main settings.

| **Setting** | **Description**                                       |
| :---------- | :---------------------------------------------------- |
| **Is On**   | Determines whether the toggle is on.                  |
| **Graphic** | Sets the check mark that shows when the toggle is on. |

To respond when the player turns the toggle on or off, pass a function to `OnValueChanged`. The function receives `true` when the toggle is on.

To let the player choose only one option from a set of toggles, such as **Easy**, **Normal**, or **Hard**, the toggles need a **ToggleGroup** component. Ask the assistant to set it up, for example, `Make the Easy, Normal, and Hard toggles a group where only one can be on.` In the **ToggleGroup** component, enable **Allow Switch Off** to let the player leave every toggle in the group off.

## Dropdown

A dropdown shows the current option. When the player selects it, a list opens so they can pick another option. A new dropdown has the options `Option A`, `Option B`, and `Option C`.

To set the options, ask the assistant, for example, `Make the quality dropdown list Low, Medium, and High.` You can also set them in a script with `ClearOptions` and `AddOption`. The dropdown's `value` is the position of the selected option in the list, starting at `0`. To respond when the player picks an option, pass a function to `OnValueChanged`.

## Additional resources

* [Introduction to UI elements](/unity-spark/create/build/ui-editor/elements/about-ui-elements.md)
* [Progress bars](/unity-spark/create/build/ui-editor/elements/progress-bars.md)
* [Write and attach scripts](/unity-spark/create/build/scripts/write-scripts.md)
