menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfSlider<TValue> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfSlider<TValue>

    Partial class SfSlider.

    Inheritance
    System.Object
    SfBaseComponent
    SfSlider<TValue>
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfSlider<TValue> : SfBaseComponent, ISlider
    Type Parameters
    Name Description
    TValue

    Generic type parameter.

    Constructors

    SfSlider()

    Declaration
    public SfSlider()

    Properties

    CssClass

    Gets or sets the custom CSS classes to be added to the slider element for styling and customization.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    A string containing CSS class names separated by spaces. The default value is an empty string.

    Remarks

    Use this property to enhance the appearance of the slider by providing one or more CSS class names, separated by spaces. These classes allow you to override or extend the default styles.

    CustomValues

    Gets or sets an array of custom values for the slider, which can be either numbers or strings. This property does not adhere to the min, max, or step values of the slider.

    Declaration
    public string[] CustomValues { get; set; }
    Property Value
    Type Description
    System.String[]

    An array of slider values, represented as numbers or strings.

    Remarks

    Use this property to define a custom range of slider values, bypassing the default constraints of minimum, maximum, or step values. Values can be either numeric or string-based.

    EnableAnimation

    Gets or sets a boolean value to enable or disable the animation for slider movement.

    Declaration
    public bool EnableAnimation { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the animation can be enabled. Otherwise, false. The default value is true.

    Enabled

    Gets or sets a boolean value to enable or disable the slider.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, Allow the user to interact with the component. Otherwise, false. The default value is true.

    EnablePersistence

    Gets or sets a boolean value to enable or disable the persisting component's state between page reloads.

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the persistence can be enabled. Otherwise, false.

    EnableRtl

    Gets or sets a boolean value to enable or disable the component rendering in right to left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the right to left direction can be enabled. Otherwise, false. The default value is false.

    ID

    Gets or sets the id attribute for the slider element.

    Declaration
    public string ID { get; set; }
    Property Value
    Type Description
    System.String

    Accepts the string value.

    IsImmediateValue

    Gets or sets whether the value need to be updated at the time of dragging slider handle.

    Declaration
    public bool IsImmediateValue { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, the value is updated immediately when the slider handle is dragged. Otherwise, false. The default value is true.

    Max

    Gets or sets the maximum value of the slider.

    Declaration
    public double Max { get; set; }
    Property Value
    Type Description
    System.Double

    Accepts a double value representing that the maximum value of slider. The default value is 100.

    Min

    Gets or sets the minimum value of the slider.

    Declaration
    public double Min { get; set; }
    Property Value
    Type Description
    System.Double

    Accepts a double value representing that the minimum value of slider. The default value is 0.

    Orientation

    Gets or sets a value which indicates whether to render the slider in vertical or horizontal orientation.

    Declaration
    public SliderOrientation Orientation { get; set; }
    Property Value
    Type Description
    SliderOrientation

    A value of the SliderOrientation enumeration that specifies the orientation of scale. The default value is Horizontal.

    ReadOnly

    Gets or sets a boolean value which indicates whether to render the slider in read-only mode to restrict any user interaction. The slider rendered with user defined values and can’t be interacted with user actions.

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the slider component cannot be edited. Otherwise, false.

    ShowButtons

    Gets or sets a boolean value which indicates whether to show or hide the increase/decrease buttons of Slider to change the slider value.

    Declaration
    public bool ShowButtons { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the increase or decrease buttons should be shown. Otherwise, false.

    Slider

    Get and set the Slider.

    Declaration
    public ElementReference Slider { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.ElementReference

    SliderEditContext

    Specifies the ChildContent.

    Declaration
    protected EditContext SliderEditContext { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.Forms.EditContext

    Step

    Gets or sets the step value for each value change when the increase / decrease button is clicked or on arrow keys press or on dragging the thumb.

    Declaration
    public double Step { get; set; }
    Property Value
    Type Description
    System.Double

    Accepts the double value that specifies the step value change when increase or decrease button is clicked or arrow key press or dragging the thumb. The default value is 1.

    Ticks

    Gets or sets the slider ticks options such as placement and step values.

    Declaration
    public SliderTicks Ticks { get; set; }
    Property Value
    Type Description
    SliderTicks

    The options for rendering the slider ticks, such as placement and step values.

    Type

    Gets or sets the type of the Slider. The available options are: Default - Allows to a single value in the Slider. MinRange - Allows to select a single value in the Slider. It display’s a shadow from the start to the current value. Range - Allows to select a range of values in the Slider. It displays shadow in-between the selection range.

    Declaration
    public SliderType Type { get; set; }
    Property Value
    Type Description
    SliderType

    One of the SliderType enumeration that specifies the type of slider in the component.

    Value

    Gets or sets the current value of the Slider. The value should be specified in array of number when render Slider type as range.

    Declaration
    public TValue Value { get; set; }
    Property Value
    Type Description
    TValue

    The current value of the Slider.

    ValueChanged

    Gets or sets a event callback which triggers when the slider value is changed.

    Declaration
    public EventCallback<TValue> ValueChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<TValue>

    An event callback function.

    Width

    Gets or sets the width of the Slider.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    Accepts the string value.

    Methods

    BuildRenderTree(RenderTreeBuilder)

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

    CloseTooltip()

    Closes the Tooltip Element.

    Declaration
    public Task CloseTooltip()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ="Task".

    GetDataId()

    Get Slider data id.

    Declaration
    public string GetDataId()
    Returns
    Type
    System.String

    OnAfterRenderAsync(Boolean)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type Description
    System.Threading.Tasks.Task

    "Task".

    Overrides
    SfBaseComponent.OnAfterRenderAsync(Boolean)

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    "Task".

    Overrides
    SfBaseComponent.OnInitializedAsync()

    OnOpen(TooltipEventArgs)

    update tooltip position.

    Declaration
    public Task OnOpen(TooltipEventArgs args)
    Parameters
    Type Name Description
    TooltipEventArgs args

    args.

    Returns
    Type Description
    System.Threading.Tasks.Task

    ="Task".

    OnParametersSetAsync()

    Method invoked when any changes in component state occurs.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    "Task".

    RepositionAsync()

    This method can be invoked in case where the slider is rendered within a popup container and the slider handle must be repositioned based on the popup rendering.

    Declaration
    public Task RepositionAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    "Task".

    TriggeredTicksRendered(ElementReference, Dictionary<String, Object>)

    Calling Ticks Rendered Event.

    Declaration
    public Task<SliderTickRenderedEventArgs> TriggeredTicksRendered(ElementReference ticksWrapperRef, Dictionary<string, object> attributes)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.ElementReference ticksWrapperRef

    args.

    System.Collections.Generic.Dictionary<System.String, System.Object> attributes

    attributes.

    Returns
    Type Description
    System.Threading.Tasks.Task<SliderTickRenderedEventArgs>

    ="Task".

    TriggeredTicksRendering(ElementReference, String, Double, Dictionary<String, Object>)

    Calling Ticks Rendering Event.

    Declaration
    public Task<SliderTickEventArgs> TriggeredTicksRendering(ElementReference ticksRef, string text, double value, Dictionary<string, object> attributes)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.ElementReference ticksRef

    ticksRef.

    System.String text

    text.

    System.Double value

    sliderValue.

    System.Collections.Generic.Dictionary<System.String, System.Object> attributes

    attributes.

    Returns
    Type Description
    System.Threading.Tasks.Task<SliderTickEventArgs>

    ="Task".

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved