# .NET MAUI Slider Ticks

The Slider for .NET MAUI can show ticks along the backtrack. Ticks help end users to more easily identify the selected value.

## Ticks Step and Placement

To display ticks along the track, define the `TickStep` and `TicksPlacement` properties of the Slider.

* `TickStep` (`double`)—Defines the values on the backtrack that will be indicated by ticks. Each tick will be placed at the specified value interval. For example, if `TickStep="5"`, your ticks will be placed on the 0, 5, 10, 15, and 20 positions on a 0-20 backtrack.
* `TickOrigin` (`double`)—Defines a custom value that indicates where the ticks originate. The position of the ticks is determined based on the combination of the `TickStep` and `TickOrigin` values. The Slider generates the ticks and labels in a way so that a tick is positioned at the given `TickOrigin`.
* `TicksPlacement`(`Telerik.Maui.Controls.RangeSlider.SliderTicksPlacement`)—Defines where the ticks are displayed relative to the position of the backtrack. The available options are:
  * `None`—No ticks are displayed.
  * `Start`—The ticks appear above the backtrack.
  * `Center`—The ticks overlay the backtrack.
  * `End`—The ticks appear below the backtrack.

## Slider SnapMode

The Slider for .NET MAUI provides snapping to ticks (the thumb snaps from tick to tick, ignoring the values in-between). This limits the selected `Value` to a predefined set of values related to the `TickStep` value. You can enable or disable snapping with the `SnapMode` property:

* `SnapMode` (`Telerik.Maui.Controls.RangeSlider.SliderSnapMode`)—Defines whether the thumb should snap to a tick, ignoring the values between ticks. The available options are:
  * `None`—The end user can move the dragged thumb freely.
  * `SnapToTicks`—The thumb is snapped to the position of the ticks when an end user is dragging it.

The snippet below shows how to apply the ticks configuration settings:

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

Check the result below:

![Telerik Slider for .NET MAUI Ticks](https://www.telerik.com/maui-ui/documentation/assets/e06c450ccc6a2342083a6a3340a12a6e/slider-ticks-settings.png)

## Tick Template

Through the `TickTemplate` property you can customize the appearance of the ticks.

* `TickTemplate` (`DataTemplate`)—Defines the template of the Slider ticks.

Check below a sample `TickTemplate` example:

**1.** First define the custom `DataTemplate`:

```XAML
<DataTemplate x:Key="CustomTickTemplate">
    <Rectangle WidthRequest="4"
               HeightRequest="10"
               BackgroundColor="#7C59B6" />
</DataTemplate>
```

**2.** Then apply it to the Slider's `TickTemplate`:

```XAML
<telerik:RadSlider x:Name="slider"
                   Minimum="0"
                   Maximum="100"
                   Value="35"
                   TicksPlacement="Start"
                   TickStep="20"
                   TickTemplate="{StaticResource CustomTickTemplate}" />
```

![Telerik Slider for .NET MAUI Ticks Template](https://www.telerik.com/maui-ui/documentation/assets/b1b059988924e4d83d9c5a9c2ab0f9a6/slider-ticks-template.png)

## See Also

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