Allow users to adjust a value within a specified range by sliding a handle.
All sliders require the min, max and step properties, specifying the range of values the slider provides. Using smaller step values results in ever so slightly smoother sliders until they can be considered "continuous". You may exclude the step prop altogether to let the sliders use its full f64 precision.
The slider always operates with f64 values and may suffer from typical IEEE-math rounding problems. We use the value_display property to specify how a selected value should be rendered.
Small step values result in lesser selectable values, as only values starting from min and increased by multiples of step are selectable. To help visualize the selectable values of the slider, marks can be automatically generated.
Note that marks are only helpful when dealing with sliders having a limited number of selectable values, meaning ones with small ranges and a high stepping value. Automatic mark generation is currently limited to creating 20 evenly spaced marks so that continuous sliders will not create thousands of them.
You can also specify custom marks! Custom marks will be validated. If the specified value is outside the sliders [min..max] range or the percentage is outside the [0..1] range, the mark will be excluded and a warning will be logged to the console.
A range of values can be selected using the RangeSlider component. The component requires two values and in return provides a slider with two control knobs, allowing you to select a range of values. One knob can be dragged over the other, letting them switch places.
Slider knobs are keyboard-interactable and can be cycled through using the Tab key. Manipulation of slider knobs using the error keys will come in a future update.