# Slider

> Creates a new instance of a Slider.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## Slider()

Creates a new instance of a Slider.

```csharp
public Slider()
```

## Slider(float, float, SliderDirection, float)

Creates a new instance of a Slider.

```csharp
public Slider(float start, float end, SliderDirection direction = SliderDirection.Horizontal, float pageSize = 0)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The minimum value that the slider encodes.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum value that the slider encodes.**** (\[SliderDirection]\(/engine/6000.5/script-reference/unityengine/uielements/sliderdirection)): The direction of the slider (Horizontal or Vertical).**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): A generic page size used to change the value when clicking in the slider.

## Slider(string, float, float, SliderDirection, float)

Creates a new instance of a Slider.

```csharp
public Slider(string label, float start = 0, float end = 10, SliderDirection direction = SliderDirection.Horizontal, float pageSize = 0)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The string representing the label that will appear beside the field.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The minimum value that the slider encodes.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum value that the slider encodes.**** (\[SliderDirection]\(/engine/6000.5/script-reference/unityengine/uielements/sliderdirection)): The direction of the slider (Horizontal or Vertical).**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): A generic page size used to change the value when clicking in the slider.
