Method Slider
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Slider(string?, float?, float?, float?, Action<float>?, string?, string?, bool?, Func<VisualElement, Action>?, Action<VisualElement>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)
Creates a Slider.
public static ElementNode Slider(string? className = null, float? value = null, float? lowValue = null, float? highValue = null, Action<float>? onValueChanged = null, string? key = null, string? name = null, bool? enabled = null, Func<VisualElement, Action>? refCallback = null, Action<VisualElement>? onCreated = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null)
Parameters
classNamestringCSS-like utility class string. Multiple classes separated by spaces.
valuefloat?Current slider value (controlled).
lowValuefloat?Minimum value of the slider range.
highValuefloat?Maximum value of the slider range.
onValueChangedAction<float>Handler invoked when the slider value changes.
keystringKey used to disambiguate siblings at the same position.
namestringElement name assigned to UnityEngine.UIElements.VisualElement.name for query/debug.
enabledbool?When false, disables the slider input.
refCallbackFunc<VisualElement, Action>Callback invoked on mount with the created VisualElement; returned Action runs on unmount.
onCreatedAction<VisualElement>Callback invoked once when the Slider VisualElement is first created.
whileHoverClassstringUSS class toggled while the pointer hovers the element.
whileTapClassstringUSS class toggled while the pointer is pressed on the element.
whileFocusClassstringUSS class toggled while the element holds keyboard/UI focus.
dataIReadOnlyDictionary<string, string>data-* attribute map matched by
data-[...]variants.ariaIReadOnlyDictionary<string, string>aria-* attribute map matched by
aria-[...]variants.
Returns
- ElementNode
The created ElementNode representing this slider.