# .NET MAUI Slider Labels

The Slider for .NET MAUI can show labels along the backtrack. This helps users to better understand the underlying range of values.

## Labels Step and Placement

To display labels, define the `LabelStep` and `LabelPlacement` properties of the Slider.

* `LabelStep`(`double`)—Defines the values on the backtrack that will be indicated by labels. Each label will be placed at the specified value interval. For example, if `LabelStep="5"`, your labels will show the 0, 5, 10, 15, and 20 values on a 0-20 backtrack.
* `LabelsPlacement`(`Telerik.Maui.Controls.RangeSlider.SliderLabelsPlacement`)—Defines where the labels are displayed relative to the position of the backtrack. The available options are:
  * `None`—No labels are displayed.
  * `Start`—The labels appear above the backtrack.
  * `End`—The labels appear below the backtrack.

Check an example on how you can configure labels:

```XAML
<telerik:RadSlider x:Name="slider"
                   Minimum="0"
                   Maximum="100"
                   Value="35"
                   TicksPlacement="End"
                   TickStep="5"
                   LabelsPlacement="End"
                   LabelStep="10" />
```

![Telerik Slider for .NET MAUI Labels](https://www.telerik.com/maui-ui/documentation/assets/318d3ab3cb1ab19e8ac93fcd7b5683df/slider-labels-settings.png)

## Labels Formatting

You can use the formatting properties to modify the text of the labels.

* `StringFormat`(`string`)—Defines a custom string format for the labels of the Slider.
* `StringConverter`(`Telerik.Maui.IStringConverter`)—Defines a custom string converter. You can use the string converter to replace the range values with more user-friendly names in your Slider labels.

Here is a quick example with a custom string converter:

**1.** Add the following sample Dictionary String Converter to your resources. It replaces the values of the range with meaningful names to make the range more readable:

```XAML
<telerik:DictionaryStringConverter x:Key="LowMidHighConverter">
    <telerik:DictionaryStringConverterItem Key="{x:Double 1}" Value="Low" />
    <telerik:DictionaryStringConverterItem Key="{x:Double 2}" Value="Mid-Low" />
    <telerik:DictionaryStringConverterItem Key="{x:Double 3}" Value="Mid" />
    <telerik:DictionaryStringConverterItem Key="{x:Double 4}" Value="Mid-High" />
    <telerik:DictionaryStringConverterItem Key="{x:Double 5}" Value="High" />
</telerik:DictionaryStringConverter>
```

**2.** Apply the converter to the Slider:

```XAML
<telerik:RadSlider Minimum="1"
                   Maximum="5"
                   TickStep="1"
                   LabelStep="2"
                   Value="35"
                   SnapMode="SnapToTicks"
                   TicksPlacement="Start"
                   LabelsPlacement="Start"
                   StringConverter="{StaticResource LowMidHighConverter}" />
    </VerticalStackLayout>
```

Check the result below:

![Telerik Slider for .NET MAUI Labels StringConverter](https://www.telerik.com/maui-ui/documentation/assets/6f7135df3ea883cda6aa17c6acd891f6/slider-labels-stringconverter.png)

## Label Template

You can use the `LabelTemplate` property to customize how the Slider labels render.

* `LabelTemplate`(`DataTemplate`)—Defines the template of the Slider labels.

Check below a sample `LabelTemplate` example:

**1.** Add the custom `DataTemplate` to your page resources:

```XAML
<DataTemplate x:Key="CustomLabelTemplate">
    <Label Text="{Binding}"
           FontSize="16"
           TextColor="#674BB2" />
</DataTemplate>
```

**2.** Apply it to the Slider's `LabelTemplate`:

```XAML
<telerik:RadSlider x:Name="slider"
                   Minimum="0"
                   Maximum="100"
                   Value="35"
                   TicksPlacement="End"
                   TickStep="5"
                   LabelsPlacement="End"
                   LabelStep="10"
                   LabelTemplate="{StaticResource CustomLabelTemplate}" />
```

Check the result below:

![Telerik Slider for .NET MAUI Label Template](https://www.telerik.com/maui-ui/documentation/assets/681886d2cb882e23dde466b22773c008/slider-labels-template.png)

## See Also

* [Ticks](https://www.telerik.com/maui-ui/documentation/controls/slider/ticks)
* [Tooltips](https://www.telerik.com/maui-ui/documentation/controls/slider/tooltips)
* [Labels Styling](https://www.telerik.com/maui-ui/documentation/controls/slider/styling/labels-styling)
