Slider Blazor API

Slider Properties

NameTypeDefaultDescription
CoerceboolfalseWith the coerce property true and clicking the track, the thumb and value are moved and set to the nearest value allowed by the interval property.
CustomIntervalboolfalseSets or gets whether custom ticks at (possibly) uneven interval will be plotted. The ticks to be plotted are defined with the property customTicks.
CustomTicksint[]new int[]{}If customInterval is enabled, sets a list of ticks to be plotted. If coerce is set to true, the value will snap to these ticks.
DateLabelFormatStringstring"d"Sets or gets the pattern which labels are displayed in when mode is 'date'.
DecimalSeparatorstring"".""Sets or gets the char to use as the decimal separator in numeric values.
DisabledboolfalseEnables or disables the widget.
EnableMouseWheelActionboolfalseEnables or disables incrementing/decrementing the value using the mouse wheel in SmartSlider.
Intervalobject1Determines what values the thumb snaps to.
InvertedboolfalseSets the direction of the slider. If is true - positions of the slider's begin and end are changed.
LabelFormatFunctionobjectN/AA callback function that can be used to format the values displayed on the slider labels and tooltip.
LabelsVisibilityLabelsVisibilityLabelsVisibility.AllSets or gets the widget's label visibility.
Localestring"en"Sets or gets the locale. Used in conjunction with the property messages.
LogarithmicScaleboolfalseEnables or disables the usage of logarithmic scale in the widget.
Maxobject100Sets or gets the maximum value of the widget.
MechanicalActionDragMechanicalActionDragMechanicalAction.SwitchWhileDraggingSets or gets the type of used mechanical action.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
Minobject0Sets or gets the minimum value of the widget.
ModeScaleModeScaleMode.NumericSets or gets whether the widget works with numbers or dates.
Namestring""Sets or gets the element's name, which is used as a reference when the data is submitted.
OrientationOrientationOrientation.HorizontalSets the orientation of the widget.
PrecisionDigitsintN/ADetermines the number of digits after the decimal point. Applicable only when scaleType is 'integer'.
RangeSliderboolfalseEnables or disables the slider to be in range mode. If is set to true, the range is represented between two thumbs.
ReadonlyboolfalseWhen the slider is read only the users cannot drag or click in the fill of the slider.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
ScalePositionScalePositionScalePosition.NearSets the position of the widget's scales.
ScaleTypeScaleTypeScaleType.FloatingPointSets the type of the slider's scale.
ScientificNotationboolfalseEnables or disables scientific notation.
ShowButtonsboolfalseEnables or disables displaying of the buttons.
ShowThumbLabelboolfalseEnables or disables displaying of the thumb label.
ShowTooltipboolfalseEnables or disables displaying of the tooltip.
ShowUnitboolfalseEnables or disables displaying of the units.
SignificantDigitsintN/ADetermining how many significant digits are in a number. Applicable only when scaleType is 'integer'.
Themestring""Sets or gets the element's visual theme.
ThumbLabelPositionPositionPosition.NearSets or gets the position of the thumb label.
TicksPositionTicksPositionTicksPosition.ScaleSets or gets the position of the ticks in SmartSlider widget.
TicksVisibilityTicksVisibilityTicksVisibility.MinorSets or gets the visibility of the ticks.
TooltipPositionPositionPosition.NearSets or gets the position of the tooltip in SmartSlider widget.
UnfocusableboolfalseSets or gets if the element can be focused.
Unitstring"kg"Sets or gets the name of unit used in SmartSlider widget.
ValidationValidationValidation.StrictSets the value's validation by min/max. If 'strict' is applied, the value is always validated by min and max. If 'interaction' is applied, programmatic value changes are not coerced to min/max and if min/max are changed, resulting in the current value being out of range, the value is not coerced, and no change event is fired.
Valueobject0Sets or gets the value of the SmartSlider widget. The property is used when the rangeSlider property is set to false.
Valuesint[]new int[]{}Sets or gets the value of the SmartSlider widget. The property is used when the rangeSlider property is set to true.
WordLengthWordLengthWordLength.Int32Sets or gets the word length. Applicable only when scaleType is 'integer'.

Slider Methods

NameTypeArgumentsDescription
GetOptimalSizeobjectN/AGets the optimal size of the widget.
GetValueAsync()Task<object>'N/A'Gets the &quot;Value&quot; property as Task&lt;object&gt;.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
ValstringIEnumerable<object> valueGet/set the value of the slider. Args: IEnumerable<object> value - The value to be set. If no parameter is passed, returns the displayed value of the slider.
ValstringN/AGet/set the value of the slider.
Valstringstring valueGet/set the value of the slider. Args: string value - The value to be set. If no parameter is passed, returns the displayed value of the slider.
Valstringint valueGet/set the value of the slider. Args: int value - The value to be set. If no parameter is passed, returns the displayed value of the slider.

Slider Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered when the value of the slider is changed. dynamic value- A numeric value indicating the scroll position., dynamic oldValue- A numeric value indicating the previous scroll position.
Changedevent SliderChangedEventHandlerThis event is triggered when the value of the slider is changed. SliderChangedEventArgs

Enums

LabelsVisibility

LabelsVisibility.All
LabelsVisibility.EndPoints
LabelsVisibility.None

DragMechanicalAction

DragMechanicalAction.SwitchUntilReleased
DragMechanicalAction.SwitchWhenReleased
DragMechanicalAction.SwitchWhileDragging

ScaleMode

ScaleMode.Numeric
ScaleMode.Date

Orientation

Orientation.Horizontal
Orientation.Vertical

ScalePosition

ScalePosition.Near
ScalePosition.Far
ScalePosition.Both
ScalePosition.None

ScaleType

ScaleType.FloatingPoint
ScaleType.Integer

Position

Position.Near
Position.Far

TicksPosition

TicksPosition.Scale
TicksPosition.Track

TicksVisibility

TicksVisibility.Major
TicksVisibility.Minor
TicksVisibility.None

Validation

Validation.Strict
Validation.Interaction

WordLength

WordLength.Int8
WordLength.Uint8
WordLength.Int16
WordLength.Uint16
WordLength.Int32
WordLength.Uint32
WordLength.Int64
WordLength.Uint64