docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Badge

    Badge UI element.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    Badge
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    Inherited Members
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    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)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public class Badge : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement

    Constructors

    Badge()

    Default constructor.

    Declaration
    public Badge()

    Fields

    badgeUssClassName

    The Badge badge styling class.

    Declaration
    public static readonly string badgeUssClassName
    Field Value
    Type Description
    string

    horizontalAnchorUssClassName

    The Badge horizontal anchor styling class prefix.

    Declaration
    public static readonly string horizontalAnchorUssClassName
    Field Value
    Type Description
    string

    labelUssClassName

    The Badge label styling class.

    Declaration
    public static readonly string labelUssClassName
    Field Value
    Type Description
    string

    overlapUssClassName

    The Badge overlap type styling class prefix.

    Declaration
    public static readonly string overlapUssClassName
    Field Value
    Type Description
    string

    ussClassName

    The Badge main styling class.

    Declaration
    public static readonly string ussClassName
    Field Value
    Type Description
    string

    variantClassName

    The Badge variant styling class prefix.

    Declaration
    public static readonly string variantClassName
    Field Value
    Type Description
    string

    verticalAnchorUssClassName

    The Badge vertical anchor styling class prefix.

    Declaration
    public static readonly string verticalAnchorUssClassName
    Field Value
    Type Description
    string

    zeroUssClassName

    The Badge Zero content styling class.

    Declaration
    public static readonly string zeroUssClassName
    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
    VisualElement.contentContainer

    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

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)