# RadzenSlider<TValue> Class

A slider component for selecting numeric values by dragging a handle along a track. RadzenSlider supports single value selection or range selection (min/max) with horizontal or vertical orientation. Provides an intuitive way to select numeric values within a range, especially useful when the exact value is less important than the approximate position, you want to show the valid range visually, or the input should be constrained to specific increments. Features single value or min/max range selection, Horizontal (default) or Vertical layout, Min/Max values defining the selectable range, Step property controlling value granularity, colored track showing selected portion for visual feedback, Arrow key support for precise adjustment, and drag gestures on mobile devices. For range selection, set Range=true and bind to IEnumerable<TValue> (e.g., IEnumerable<int>) for min/max values. Common uses include price filters, volume controls, zoom levels, or any bounded numeric input.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- [FormComponent<TValue>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md)
- RadzenSlider<TValue>

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IRadzenFormComponent](https://blazor.radzen.com/docs/api/Radzen.IRadzenFormComponent.md)

## Syntax

```csharp
public class RadzenSlider<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent
```

## Type Parameters

| Name | Description |
|------|-------------|
| TValue | The type of the slider value. Supports numeric types (int, decimal, double) or IEnumerable for range selection. |

## Examples

Basic slider:

```razor
<RadzenSlider @bind-Value=@volume TValue="int" Min="0" Max="100" />
@code {
    int volume = 50;
}
```

Range slider for price filter:

```razor
<RadzenSlider @bind-Value=@priceRange TValue="IEnumerable<decimal>" Range="true" 
              Min="0" Max="1000" Step="10" />
@code {
    IEnumerable<decimal> priceRange = new decimal[] { 100, 500 };
}
```

Vertical slider with step:

```razor
<RadzenSlider @bind-Value=@value TValue="double" Min="0" Max="1" Step="0.1" 
              Orientation="Orientation.Vertical" Style="height: 200px;" />
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenSlider<TValue>()` | A slider component for selecting numeric values by dragging a handle along a track. RadzenSlider supports single value selection or range selection (min/max) with horizontal or vertical orientation. Provides an intuitive way to select numeric values within a range, especially useful when the exact value is less important than the approximate position, you want to show the valid range visually, or the input should be constrained to specific increments. Features single value or min/max range selection, Horizontal (default) or Vertical layout, Min/Max values defining the selectable range, Step property controlling value granularity, colored track showing selected portion for visual feedback, Arrow key support for precise adjustment, and drag gestures on mobile devices. For range selection, set Range=true and bind to IEnumerable<TValue> (e.g., IEnumerable<int>) for min/max values. Common uses include price filters, volume controls, zoom levels, or any bounded numeric input. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| HandleLabel | `string` | Gets or sets the accessible name (aria-label) for the handle of a single-value slider. |
| HasValue | `bool` | Gets a value indicating whether this instance has value. |
| Max | `decimal` | Determines the maximum value. |
| MaxHandleLabel | `string` | Gets or sets the accessible name (aria-label) for the maximum handle of a range slider. |
| Min | `decimal` | Determines the minimum value. |
| MinHandleLabel | `string` | Gets or sets the accessible name (aria-label) for the minimum handle of a range slider. |
| Orientation | [`Orientation`](https://blazor.radzen.com/docs/api/Radzen.Orientation.md) | Specifies the orientation. Set to Orientation.Horizontal by default. |
| Range | `bool` | Gets or sets a value indicating whether this [RadzenSlider<T>](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenSlider-1.md) is range. |
| Step | `string` | Gets or sets the step. |
| Value | `TValue` | Gets or sets the value. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `Dispose()` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `OnAfterRenderAsync(bool firstRender)` | `Task` |  |
| `OnValueChange(decimal value, bool isMin)` | `Task` | Called when value changed. Parameters: `value`: The value. `isMin`: if set to true [is minimum]. |
| `SetParametersAsync(ParameterView parameters)` | `Task` |  |

## Inherited Members

- From [FormComponent<TValue>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md): Change, CurrentPlaceholder, Disabled, EditContext, FieldIdentifier, FocusAsync, Form, FormFieldContext, FormFieldLabelledBy, GetClassList, GetValue, IsBound, LabelTargetId, LabelToLink, LinkLabelAsync, Name, NotifyFieldChanged, OnContextMenu, Placeholder, ShouldLinkLabel, TabIndex, ValueChanged, ValueExpression, _value
- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnBecameInvisible, OnInitialized, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

