Skip to main content

Slider

Example

var slider = new UiSlider(0, 0, 200, 30);
slider.set_thumb_radius(10);
with (slider.state) {
step = 3;
}

State reference

VariableDescriptionTypeDefault
typeSlider variantRealui_enum_variants.primary
statusCurrent status of the sliderRealui_enum_slider_status.idle
directionSlider directionRealui_enum_slider_direction.horizontal
min_valueMinimum selectable valueReal0
max_valueMaximum selectable valueReal100
stepGranularity of the slider. The step increment should be a divisor of the track's lengthReal1
valueCurrent selected valueReal0
track_marginThe margin to apply to the start and the end of the slider trackReal0

Methods

set_thumb_radius(radius)

Set the thumb's radius

ParamDescriptionTypeDefault
radiusRadius of the slider's thumbReal

Events

on_change(component, value)

Called when the slider position changes. value indicates the current normalized (0-1) slider position.

Enums

EnumValues
ui_enum_slider_statusidle/hover/dragging
ui_enum_slider_directionvertical/horizontal