Class SfSlider<TValue>
The Slider component allows the user to select a value or range of values
in-between the min and max range, by dragging the handle over the slider bar.
Inheritance
System.Object
Syncfusion.Blazor.SfBaseComponent
SfSlider<TValue>
Assembly: Syncfusion.Blazor.dll
public class SfSlider<TValue> : SfBaseComponent, ISlider
Type Parameters
Constructors
Declaration
Properties
Specifies the color to the slider based on given value.
Declaration
public List<ColorRangeDataModel> ColorRange { get; set; }
Property Value
Specifies the custom classes to be added to the element used to customize the slider.
Declaration
public string CssClass { get; set; }
Property Value
Type |
Description |
System.String |
|
Specifies an array of slider values in number or string type.
The min and max step values are not considered.
Declaration
public string[] CustomValues { get; set; }
Property Value
Type |
Description |
System.String[] |
|
Enables/Disables the animation for slider movement.
Declaration
public bool EnableAnimation { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Enables or disables the slider.
Declaration
public bool Enabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Defines whether to allow the cross-scripting site or not.
Declaration
public bool EnableHtmlSanitizer { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Enable or disable persisting component's state between page reloads.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Used to specify an additional html attributes such as styles, class, and more to the root element.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Sets id attribute for the slider element.
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Specifies 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 |
|
Specified the limit within which the slider to be moved.
Declaration
public SliderLimits Limits { get; set; }
Property Value
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
Type |
Description |
System.String |
|
Specifies the maximum value of the slider.
Declaration
public double Max { get; set; }
Property Value
Type |
Description |
System.Double |
|
Specifies the minimum value of the slider.
Declaration
public double Min { get; set; }
Property Value
Type |
Description |
System.Double |
|
Specifies whether to render the slider in vertical or horizontal orientation.
Declaration
public SliderOrientation Orientation { get; set; }
Property Value
Specifies whether the 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 |
|
Specifies 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 |
|
Declaration
public ElementReference Slider { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.ElementReference |
|
Specifies 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 |
|
It is used to render the slider ticks options such as placement and step values.
Declaration
public SliderTicks Ticks { get; set; }
Property Value
Specifies the visibility, position of the tooltip over the slider element.
Declaration
public SliderTooltip Tooltip { get; set; }
Property Value
Defines 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
It is used to denote 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
Gets or sets a callback of the bound value.
Declaration
public EventCallback<TValue> ValueChanged { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<TValue> |
|
Specifies the width of the Slider.
Declaration
public string Width { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder |
__builder |
|
Declaration
public Task CloseTooltip()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type |
Name |
Description |
System.Boolean |
firstRender |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(System.Boolean)
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnInitializedAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
This method is used to reposition slider.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Calling Ticks Rendered Event
Declaration
public Task<SliderTickRenderedEventArgs> TriggeredTicksRendered(ElementReference tickscontainerRef, Dictionary<string, object> attributes)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.ElementReference |
tickscontainerRef |
|
System.Collections.Generic.Dictionary<System.String, System.Object> |
attributes |
|
Returns
Calling Ticks Rendering Event
Declaration
public Task<SliderTickEventArgs> TriggeredTicksRendering(ElementReference ticksRef, string text, double sliderValue, Dictionary<string, object> attributes)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.ElementReference |
ticksRef |
|
System.String |
text |
|
System.Double |
sliderValue |
|
System.Collections.Generic.Dictionary<System.String, System.Object> |
attributes |
|
Returns