Method RadioButtonGroup
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
RadioButtonGroup(string?, int?, List<string>?, Action<int>?, string?, string?, string?, bool?, Func<VisualElement, Action>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)
Creates a RadioButtonGroup that materializes a set of radio buttons from a list of choices.
public static ElementNode RadioButtonGroup(string? className = null, int? value = null, List<string>? choices = 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)
Parameters
classNamestringCSS-like utility class string. Multiple classes separated by spaces.
valueint?Selected index within
choices(controlled).choicesList<string>List of label strings, one per radio button.
onValueChangedAction<int>Handler invoked with the new selected index when the choice changes.
keystringKey used to disambiguate siblings at the same position.
namestringElement name assigned to UnityEngine.UIElements.VisualElement.name for query/debug.
labelstringGroup-level label text.
enabledbool?When false, disables user interaction with the entire group.
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.
Returns
- ElementNode
The created ElementNode representing this radio button group.