Class Badge
Badge UI element.
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 Badge : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder
Constructors
Badge()
Default constructor.
Declaration
public Badge()
Fields
badgeUssClassName
The Badge badge styling class.
Declaration
public const string badgeUssClassName = "appui-badge__badge"
Field Value
Type | Description |
---|---|
string |
horizontalAnchorUssClassName
The Badge horizontal anchor styling class prefix.
Declaration
public const string horizontalAnchorUssClassName = "appui-badge--anchor-horizontal-"
Field Value
Type | Description |
---|---|
string |
labelUssClassName
The Badge label styling class.
Declaration
public const string labelUssClassName = "appui-badge__label"
Field Value
Type | Description |
---|---|
string |
overlapUssClassName
The Badge overlap type styling class prefix.
Declaration
public const string overlapUssClassName = "appui-badge--overlap-"
Field Value
Type | Description |
---|---|
string |
ussClassName
The Badge main styling class.
Declaration
public const string ussClassName = "appui-badge"
Field Value
Type | Description |
---|---|
string |
variantClassName
The Badge variant styling class prefix.
Declaration
public const string variantClassName = "appui-badge--"
Field Value
Type | Description |
---|---|
string |
verticalAnchorUssClassName
The Badge vertical anchor styling class prefix.
Declaration
public const string verticalAnchorUssClassName = "appui-badge--anchor-vertical-"
Field Value
Type | Description |
---|---|
string |
zeroUssClassName
The Badge Zero content styling class.
Declaration
public const string zeroUssClassName = "appui-badge--zero"
Field Value
Type | Description |
---|---|
string |
Properties
backgroundColor
The background color of the Badge.
Declaration
public Optional<Color> backgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Optional<Color> |
color
The content color of the Badge.
Declaration
public Optional<Color> color { get; set; }
Property Value
Type | Description |
---|---|
Optional<Color> |
content
The text of the Badge.
Declaration
public int content { get; set; }
Property Value
Type | Description |
---|---|
int |
contentContainer
The content container of the Badge.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
horizontalAnchor
The horizontal anchor of the Badge.
Declaration
public HorizontalAnchor horizontalAnchor { get; set; }
Property Value
Type | Description |
---|---|
HorizontalAnchor |
max
The maximum value of the Badge.
Declaration
public int max { get; set; }
Property Value
Type | Description |
---|---|
int |
overlapType
The overlap type of the Badge.
Declaration
public BadgeOverlapType overlapType { get; set; }
Property Value
Type | Description |
---|---|
BadgeOverlapType |
showZero
Whether the Badge should show zero values.
Declaration
public bool showZero { get; set; }
Property Value
Type | Description |
---|---|
bool |
variant
The variant of the Badge.
Declaration
public BadgeVariant variant { get; set; }
Property Value
Type | Description |
---|---|
BadgeVariant |
verticalAnchor
The vertical anchor of the Badge.
Declaration
public VerticalAnchor verticalAnchor { get; set; }
Property Value
Type | Description |
---|---|
VerticalAnchor |
Methods
GetHorizontalAnchorUssClassName(HorizontalAnchor)
Declaration
public static string GetHorizontalAnchorUssClassName(HorizontalAnchor enumValue)
Parameters
Type | Name | Description |
---|---|---|
HorizontalAnchor | enumValue |
Returns
Type | Description |
---|---|
string |
GetOverlapUssClassName(BadgeOverlapType)
Declaration
public static string GetOverlapUssClassName(BadgeOverlapType enumValue)
Parameters
Type | Name | Description |
---|---|---|
BadgeOverlapType | enumValue |
Returns
Type | Description |
---|---|
string |
GetVariantUssClassName(BadgeVariant)
Declaration
public static string GetVariantUssClassName(BadgeVariant enumValue)
Parameters
Type | Name | Description |
---|---|---|
BadgeVariant | enumValue |
Returns
Type | Description |
---|---|
string |
GetVerticalAnchorUssClassName(VerticalAnchor)
Declaration
public static string GetVerticalAnchorUssClassName(VerticalAnchor enumValue)
Parameters
Type | Name | Description |
---|---|---|
VerticalAnchor | enumValue |
Returns
Type | Description |
---|---|
string |