# Blazor Slider Overview

The <a href="https://www.telerik.com/blazor-ui/slider" target="_blank">Blazor Slider component</a> allows the user to select a value by dragging its handle along the track, or by clicking the side arrow buttons. It provides templates, various configuration options, validation and keyboard navigation.

## Creating Slider

1. Use the `TelerikSlider` tag to add the component to your razor page.

2. Provide the `Value` (one-way data binding) or `bind-Value` (two-way data binding) property.

3. Choose the `Min`, `Max`, `SmallStep` and `LargeStep` settings to define the appearance and behavior of the Slider.

> caption Creating Slider with two-way value binding and main features

<demo metaUrl="client/slider/overview/" height="250"></demo>

## Component Reference

The Slider is a generic component that takes the type of the `Value` which can be e numerical type.

<demo metaUrl="client/slider/reference/" height="250"></demo>

## Steps

The Slider works with small and large steps and they are both required. Read more for their configuration and explore examples in the [Steps article](https://www.telerik.com/blazor-ui/documentation/components/slider/steps).

## Ticks Position

The Slider lets you choose where its ticks will render. You can control that through the `TickPosition` parameter. It takes a member of the `Telerik.Blazor.SliderTickPosition` enum. Can be `Before`, `After`, `Both` (the default), `None`. For example, with the default horizontal slider, these values will render ticks above, below, both above and below, and no ticks.

## Orientation

You can customize the default horizontal orientation of the Slider through its `Orientation` parameter. Takes a member of the `Telerik.Blazor.SliderOrientation` enum which contains `Horizontal`(the default) and `Vertical` options.

## Decimals

This setting helps avoid [round-off errors](https://en.wikipedia.org/wiki/Round-off_error) when calculating steps (see more about this type of errors [here](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems)). Explore the [Decimals article](https://www.telerik.com/blazor-ui/documentation/components/rangeslider/decimals) for details on how to configure this option.

## Validation

You can validate Slider value using the built-in validation. See the [Input Validation](https://www.telerik.com/blazor-ui/documentation/common-features/input-validation) article for more details.

## Parameters

The Slider provides various parameters that allow you to configure the component:

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter       | Type                                     | Description                                                                                                                                                                                                                                                                                                                              |
| --------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Decimals`      | `int`                                    | The number precision for the steps.                                                                                                                                                                                                                                                                                                      |
| `Enabled`       | `bool`                                   | Sets if the component accepts user interaction.                                                                                                                                                                                                                                                                                          |
| `LabelTemplate` | `RenderFragment<TValue>`                 | A container for custom labels for the major ticks.                                                                                                                                                                                                                                                                                       |
| `LargeStep`     | `TValue`                                 | The numeric interval between the large ticks. Read more in [Slider Steps](https://www.telerik.com/blazor-ui/documentation/components/slider/steps).                                                                                                                                                                                      |
| `Max`           | `TValue`                                 | The maximum value of the Slider. Required.                                                                                                                                                                                                                                                                                               |
| `Min`           | `TValue`                                 | The minimum value on the Slider. Required and must be less than `Max`.                                                                                                                                                                                                                                                                   |
| `SmallStep`     | `TValue`                                 | The numeric interval between all selectable Slider values. The parameter also defines where small ticks appear on the track. The Slider `Value` may be between two small ticks, but such a value can only be set programmatically. Read more in [Slider Steps](https://www.telerik.com/blazor-ui/documentation/components/slider/steps). |
| `Orientation`   | `SliderOrientation` <br/> (`Horizontal`) | Defines whether the Slider is horizontal or vertical.                                                                                                                                                                                                                                                                                    |
| `TickPosition`  | `SliderTickPosition` <br/> (`Both`)      | Sets which side of the Slider shows ticks.                                                                                                                                                                                                                                                                                               |
| `ShowButtons`   | `bool` <br /> (`true`)                   | Sets if the Slider renders buttons to increase and decrease the `Value`.                                                                                                                                                                                                                                                                 |
| `Value`         | `TValue`                                 | The Slider value. Can be a numerical type (such as `int`, `decimal`, `double` and so on).                                                                                                                                                                                                                                                |

### Styling and Appearance

The following parameters enable you to customize the appearance of the Blazor Slider:

| Parameter | Type     | Description                                                                                                                                                                                                                                                                                     |
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Class`   | `string` | the CSS class that will be rendered on the main wrapping element of the slider.                                                                                                                                                                                                                 |
| `Width`   | `stirng` | the width of the main element. In case you would like it to fit to a container you could set it to `100%` or other percent value depending on the application needs. You can read more in the [Dimensions](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions) article. |

## Next Steps

* [Slider Steps](https://www.telerik.com/blazor-ui/documentation/components/slider/steps)

## See Also

* [Live Demo: Slider](https://demos.telerik.com/blazor-ui/slider/overview)
* [Live Demo: Slider Settings](https://demos.telerik.com/blazor-ui/slider/customization)
* [Slider Events](https://www.telerik.com/blazor-ui/documentation/components/slider/events)
