docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Panel

    This is the main UI element of any Runtime App. The Panel class will create different UI layers for the main user-interface, popups, notifications and tooltips.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    Panel
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    Inherited Members
    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 Panel : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle

    Constructors

    Panel()

    Default constructor.

    Declaration
    public Panel()

    Fields

    contextPrefix

    Prefix used in App UI context USS classes.

    Declaration
    public const string contextPrefix = "appui--"
    Field Value
    Type Description
    string

    mainContainerName

    The name of the main UI layer.

    Declaration
    public const string mainContainerName = "main-container"
    Field Value
    Type Description
    string

    notificationContainerName

    The name of the Notifications layer.

    Declaration
    public const string notificationContainerName = "notification-container"
    Field Value
    Type Description
    string

    popupContainerName

    The name of the Popups layer.

    Declaration
    public const string popupContainerName = "popup-container"
    Field Value
    Type Description
    string

    tooltipContainerName

    The name of the Tooltip layer.

    Declaration
    public const string tooltipContainerName = "tooltip-container"
    Field Value
    Type Description
    string

    ussClassName

    Main Uss Class Name.

    Declaration
    public const string ussClassName = "appui"
    Field Value
    Type Description
    string

    Properties

    contentContainer

    The main UI layer container.

    Declaration
    public override VisualElement contentContainer { get; }
    Property Value
    Type Description
    VisualElement
    Overrides
    VisualElement.contentContainer

    forceUseTooltipSystem

    If true, the panel will use the tooltip system, even if the default UI-Toolkit tooltips are enabled.

    Declaration
    [Tooltip("Force the use of the tooltip system, even if the default UI-Toolkit tooltips are enabled.")]
    public bool forceUseTooltipSystem { get; set; }
    Property Value
    Type Description
    bool

    lang

    The default language for this panel.

    Declaration
    [Tooltip("The default language for this panel.")]
    public string lang { get; set; }
    Property Value
    Type Description
    string

    layoutDirection

    The default layout direction for this panel.

    Declaration
    [Tooltip("The default layout direction for this panel.")]
    public Dir layoutDirection { get; set; }
    Property Value
    Type Description
    Dir

    notificationContainer

    The Notifications layer container.

    Declaration
    public VisualElement notificationContainer { get; }
    Property Value
    Type Description
    VisualElement

    popupContainer

    The Popups layer container.

    Declaration
    public VisualElement popupContainer { get; }
    Property Value
    Type Description
    VisualElement

    preferredTooltipPlacement

    The default preferred tooltip placement for this panel.

    Declaration
    [Tooltip("The default preferred tooltip placement for this panel.\nNote that this is just the ideal placement, the tooltip will be placed on the opposite side if there is not enough space.")]
    public PopoverPlacement preferredTooltipPlacement { get; set; }
    Property Value
    Type Description
    PopoverPlacement
    Remarks

    Note that this is just the ideal placement, the tooltip will be placed on the opposite side if there is not enough space.

    scale

    The default scale for this panel.

    Declaration
    [Tooltip("The default scale for this panel.")]
    public string scale { get; set; }
    Property Value
    Type Description
    string

    theme

    The default theme for this panel.

    Declaration
    [Tooltip("The default theme for this panel.")]
    public string theme { get; set; }
    Property Value
    Type Description
    string

    tooltipContainer

    The Tooltip layer container.

    Declaration
    public VisualElement tooltipContainer { get; }
    Property Value
    Type Description
    VisualElement

    tooltipDelayMs

    The default tooltip delay in milliseconds for this panel.

    Declaration
    [Tooltip("The default tooltip delay in milliseconds for this panel.")]
    public int tooltipDelayMs { get; set; }
    Property Value
    Type Description
    int

    Methods

    FindNotificationLayer(VisualElement)

    Utility method to quickly find the current application's Notification layer.

    Declaration
    public static VisualElement FindNotificationLayer(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    An element present in the application visual tree.

    Returns
    Type Description
    VisualElement

    The Notification layer container.

    FindPopupLayer(VisualElement)

    Utility method to quickly find the current application's Popup layer.

    Declaration
    public static VisualElement FindPopupLayer(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    An element present in the application visual tree.

    Returns
    Type Description
    VisualElement

    The Popup layer container.

    FindTooltipLayer(VisualElement)

    Utility method to quickly find the current application's Tooltip layer.

    Declaration
    public static VisualElement FindTooltipLayer(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    An element present in the application visual tree.

    Returns
    Type Description
    VisualElement

    The Tooltip layer container.

    GetLayoutDirectionUssClassName(Dir)

    Declaration
    public static string GetLayoutDirectionUssClassName(Dir enumValue)
    Parameters
    Type Name Description
    Dir enumValue
    Returns
    Type Description
    string

    UnregisterPopup(Popup)

    Unregister a Popup from the list of dismissable popups.

    Declaration
    public void UnregisterPopup(Popup anchorPopup)
    Parameters
    Type Name Description
    Popup anchorPopup

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle

    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)