Class FloatFieldSlider
A UI Toolkit Slider that includes an editable text field displaying the current float value. Dragging the slider updates the field; typing a new value into the field updates the slider.
public class FloatFieldSlider : Slider
Inheritance
object→CallbackEventHandler→Focusable→VisualElement→BindableElement→BaseField<float>→BaseSlider<float>→Slider→FloatFieldSliderExamples
// In UXML:
//
// In C#:
var slider = new FloatFieldSlider(0f, 100f);
slider.value = 42f;
rootVisualElement.Add(slider);
Remarks
Use this element in UXML in place of a plain Slider wherever the user also needs to enter
a precise numeric value. The text field is appended inside the slider's input area and shares
the same USS class hierarchy for consistent styling.
Constructors
FloatFieldSlider()
Initializes a new FloatFieldSlider with default range and orientation.
public FloatFieldSlider()
FloatFieldSlider(float, float, SliderDirection, float)
Initializes a new FloatFieldSlider with the specified range and orientation.
public FloatFieldSlider(float start, float end, SliderDirection direction = SliderDirection.Horizontal, float pageSize = 0)
Parameters
| Name | Type | Description |
|---|---|---|
start | float | The minimum value of the slider. |
end | float | The maximum value of the slider. |
direction | SliderDirection | The slider orientation (horizontal or vertical). |
pageSize | float | The page-size increment used when clicking the track. |