Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ToggleButtonGroup

A control that allows single or multiple selection out of a logical group of Button elements.
Read time 7 minutesLast updated 2 days ago

Definition

[UxmlElement(null, new Type[] { typeof(Button) })]public class ToggleButtonGroup : BaseField<ToggleButtonGroupState>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IBindable, INotifyValueChanged<ToggleButtonGroupState>, IMixedValueSupport

Remarks

The ToggleButtonGroup has a label and a group of interactable Button elements.
To create buttons, add Button elements directly to the ToggleButtonGroup. This will automatically style and configure the button to work properly.

Static Fields

Value

Description

buttonClassNameUSS class name for any Buttons in the group.
buttonGroupClassNameUSS class name of container element of this type.
buttonLeftClassNameUSS class name for the leftmost Button in the group.
buttonMidClassNameUSS class name for any Buttons in the middle of the group.
buttonRightClassNameUSS class name for the rightmost Button in the group.
buttonStandaloneClassNameUSS class name for the Button if only one is available in the group.
containerUssClassNameUSS class name of container element of this type.
emptyStateLabelClassNameUSS class name for empty state label.
ussClassNameUSS class name of elements for this type.

Constructors

Constructor

Description

ToggleButtonGroup()Constructs a ToggleButtonGroup.
ToggleButtonGroup(System.String)Constructs a ToggleButtonGroup.
ToggleButtonGroup(System.String,UnityEngine.UIElements.ToggleButtonGroupState)Constructs a ToggleButtonGroup.
ToggleButtonGroup(UnityEngine.UIElements.ToggleButtonGroupState)Constructs a ToggleButtonGroup.

Properties

Property

Description

allowEmptySelectionAllows having all buttons to be unchecked when set to true.
isMultipleSelectionWhether all buttons can be selected.

Methods

Method

Description

SetValueWithoutNotifySets a new value without triggering any change event.

Inheritance

Inherited Members