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.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<TValue>

RadzenSlider<TValue>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponent<TValue>.GetValue

FormComponent<TValue>.OnContextMenu

FormComponent<TValue>.GetClassList

FormComponent<TValue>.FocusAsync

FormComponent<TValue>.Name

FormComponent<TValue>.TabIndex

FormComponent<TValue>.Placeholder

FormComponent<TValue>.Disabled

FormComponent<TValue>.EditContext

FormComponent<TValue>.Form

FormComponent<TValue>.ValueChanged

FormComponent<TValue>.IsBound

FormComponent<TValue>.Change

FormComponent<TValue>.FieldIdentifier

FormComponent<TValue>.ValueExpression

FormComponent<TValue>.FormFieldContext

FormComponent<TValue>.CurrentPlaceholder

FormComponent<TValue>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

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

Type Parameters

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

Examples

Basic slider:

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

Range slider for price filter:

<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:

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

Constructors

RadzenSlider<TValue>link

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.

Declaration
public RadzenSlider<TValue>()

Properties

HasValuelink

Gets a value indicating whether this instance has value.

Declaration
public bool HasValue { get; }
Property Value
Type Description
boolGets a value indicating whether this instance has value.

Maxlink

Determines the maximum value.

Declaration
public decimal Max { get; set; }
Property Value
Type Description
decimalDetermines the maximum value.

Minlink

Determines the minimum value.

Declaration
public decimal Min { get; set; }
Property Value
Type Description
decimalDetermines the minimum value.

Orientationlink

Specifies the orientation. Set to Orientation.Horizontal by default.

Declaration
public Orientation Orientation { get; set; }
Property Value
Type Description
OrientationSpecifies the orientation. Set to Orientation.Horizontal by default.

Rangelink

Gets or sets a value indicating whether this RadzenSlider<T> is range.

Declaration
public bool Range { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenSlider<T> is range.

Steplink

Gets or sets the step.

Declaration
public string Step { get; set; }
Property Value
Type Description
stringGets or sets the step.

Valuelink

Gets or sets the value.

Declaration
public TValue Value { get; set; }
Property Value
Type Description
TValueGets or sets the value.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

Disposelink

Declaration
public override void Dispose()

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnAfterRenderAsynclink

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type Name Description
bool firstRender
Returns
Type Description
Task

OnValueChangelink

Called when value changed.

Declaration
public Task OnValueChange(decimal value, bool isMin)
Parameters
Type Name Description
decimal value The value.
bool isMin if set to true [is minimum].
Returns
Type Description
Task

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙