Class IconButton
IconButton UI element.
Inheritance
IconButton
Implements
Inherited Members
VisualElement.ExecuteDefaultAction(EventBase)
VisualElement.Focus()
VisualElement.Overlaps(Rect)
VisualElement.ToString()
VisualElement.GetFirstOfType<T>()
VisualElement.GetFirstAncestorOfType<T>()
VisualElement.canGrabFocus
VisualElement.focusController
VisualElement.cacheAsBitmap
CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class IconButton : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, ISizeableElement, IPressable
Constructors
IconButton()
Default constructor.
Declaration
public IconButton()
IconButton(string, Action)
Construct an IconButton with a given icon.
Declaration
public IconButton(string iconName, Action clickEvent = null)
Parameters
Type | Name | Description |
---|---|---|
string | iconName | The name of the icon. |
Action | clickEvent | The click event callback. |
Fields
containerUssClassName
The IconButton leading container styling class.
Declaration
public const string containerUssClassName = "appui-button__leadingcontainer"
Field Value
Type | Description |
---|---|
string |
iconUssClassName
The IconButton leading icon styling class.
Declaration
public const string iconUssClassName = "appui-button__leadingicon"
Field Value
Type | Description |
---|---|
string |
primaryUssClassName
The IconButton primary variant styling class.
Declaration
public const string primaryUssClassName = "appui-button--primary"
Field Value
Type | Description |
---|---|
string |
quietUssClassName
The IconButton quiet mode styling class.
Declaration
public const string quietUssClassName = "appui-button--quiet"
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The IconButton size styling class.
Declaration
public const string sizeUssClassName = "appui-button--size-"
Field Value
Type | Description |
---|---|
string |
ussClassName
The IconButton main styling class.
Declaration
public const string ussClassName = "appui-button"
Field Value
Type | Description |
---|---|
string |
Properties
clickable
Clickable Manipulator for this Button.
Declaration
public Pressable clickable { get; set; }
Property Value
Type | Description |
---|---|
Pressable |
icon
The IconButton icon.
Declaration
public string icon { get; set; }
Property Value
Type | Description |
---|---|
string |
primary
Use the primary variant of the Button.
Declaration
public bool primary { get; set; }
Property Value
Type | Description |
---|---|
bool |
quiet
The quiet state of the Button.
Declaration
public bool quiet { get; set; }
Property Value
Type | Description |
---|---|
bool |
size
The Button size.
Declaration
public Size size { get; set; }
Property Value
Type | Description |
---|---|
Size |
variant
The IconButton icon variant.
Declaration
public IconVariant variant { get; set; }
Property Value
Type | Description |
---|---|
IconVariant |
Methods
GetSizeUssClassName(Size)
Declaration
public static string GetSizeUssClassName(Size enumValue)
Parameters
Type | Name | Description |
---|---|---|
Size | enumValue |
Returns
Type | Description |
---|---|
string |
Events
clicked
Event triggered when the Button has been clicked.
Declaration
public event Action clicked
Event Type
Type | Description |
---|---|
Action |