Method IntegerField
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
IntegerField(string?, int?, Action<int>?, string?, string?, string?, bool?, Func<VisualElement, Action>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, FiberEventBinding[]?)
Creates an IntegerField for entering integer values.
public static ElementNode IntegerField(string? className = null, int? value = null, Action<int>? onValueChanged = null, string? key = null, string? name = null, string? label = null, bool? enabled = null, Func<VisualElement, Action>? refCallback = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null, FiberEventBinding[]? events = null)
Parameters
classNamestringCSS-like utility class string. Multiple classes separated by spaces. Background, border, radius, padding, shadow and ring utilities style the field's box;
Documentation~/styling-variants.mdowns the list.valueint?Current integer value (controlled).
onValueChangedAction<int>Handler invoked when the integer value changes.
keystringKey used to disambiguate siblings at the same position.
namestringElement name assigned to UnityEngine.UIElements.VisualElement.name for query/debug.
labelstringLabel text shown next to the field.
enabledbool?When false, disables user input.
refCallbackFunc<VisualElement, Action>Callback invoked on mount with the created VisualElement; returned Action runs on unmount.
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.eventsFiberEventBinding[]Event bindings applied to the element, bound after
onValueChanged's own (Documentation~/react-migration.mdowns the rule). The array is read and never written.
Returns
- ElementNode
The created ElementNode representing this integer field.