docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AppBar

    AppBar is a component that can be used to display a title, a back button, a drawer button and a set of actions.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    ExVisualElement
    AppBar
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    Inherited Members
    ExVisualElement.outlineColor
    ExVisualElement.backgroundColor
    ExVisualElement.passMask
    BaseVisualElement.contextPrefix
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    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 AppBar : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement

    Constructors

    AppBar()

    Creates a new AppBar.

    Declaration
    public AppBar()

    Fields

    actionContainerUssClassName

    USS class name of the AppBar's action container.

    Declaration
    public const string actionContainerUssClassName = "appui-appbar__action-container"
    Field Value
    Type Description
    string

    backButtonUssClassName

    USS class name of the AppBar's back button.

    Declaration
    public const string backButtonUssClassName = "appui-appbar__back-button"
    Field Value
    Type Description
    string

    barUssClassName

    USS class name of the AppBar's bar.

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

    bottomBorderUssClassName

    USS class name of the AppBar's bottom border element.

    Declaration
    public const string bottomBorderUssClassName = "appui-appbar__bottom-border"
    Field Value
    Type Description
    string

    bottomUssClassName

    USS class name of the AppBar's bottom element.

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

    compactTitleUssClassName

    USS class name of the AppBar's compact title.

    Declaration
    public const string compactTitleUssClassName = "appui-appbar__compact-title"
    Field Value
    Type Description
    string

    compactUssClassName

    USS class name of the AppBar's compact variant.

    Declaration
    public const string compactUssClassName = "appui-appbar--compact"
    Field Value
    Type Description
    string

    drawerButtonUssClassName

    USS class name of the AppBar's drawer button.

    Declaration
    public const string drawerButtonUssClassName = "appui-appbar__drawer-button"
    Field Value
    Type Description
    string

    elevationUssClassName

    USS class name of the AppBar's elevation.

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

    flexibleSpaceUssClassName

    USS class name of the AppBar's flexible space.

    Declaration
    public const string flexibleSpaceUssClassName = "appui-appbar__flexible-space"
    Field Value
    Type Description
    string

    largeTitleUssClassName

    USS class name of the AppBar's large title.

    Declaration
    public const string largeTitleUssClassName = "appui-appbar__large-title"
    Field Value
    Type Description
    string

    stretchUssClassName

    USS class name of the AppBar's stretch variant.

    Declaration
    public const string stretchUssClassName = "appui-appbar--stretch"
    Field Value
    Type Description
    string

    ussClassName

    Main USS class name of the AppBar.

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

    Properties

    bottom

    Container element for the AppBar's bottom element. This element is located below the flexible space.

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

    compact

    The compactness of the AppBar. Set to true to make it compact. Set to false to use the default size.

    Declaration
    public bool compact { get; set; }
    Property Value
    Type Description
    bool

    contentContainer

    The content container of this element.

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

    elevation

    The elevation of the AppBar.

    Declaration
    public int elevation { get; set; }
    Property Value
    Type Description
    int

    expandedHeight

    The height of the AppBar when it is expanded. See stretch.

    Declaration
    public float expandedHeight { get; set; }
    Property Value
    Type Description
    float

    flexibleSpace

    The flexible space element.

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

    scrollOffset

    Set this value based on the scrollview's scrollOffset in order to stretch the AppBar accordingly.

    Declaration
    public float scrollOffset { get; set; }
    Property Value
    Type Description
    float

    showBackButton

    Display or hide the AppBar's back button.

    Declaration
    public bool showBackButton { get; set; }
    Property Value
    Type Description
    bool

    showDrawerButton

    Display or hide the AppBar's drawer button.

    Declaration
    public bool showDrawerButton { get; set; }
    Property Value
    Type Description
    bool

    stretch

    The stretch of the AppBar. Set to true to make it stretchable. Set to false to make it fixed.

    Declaration
    public bool stretch { get; set; }
    Property Value
    Type Description
    bool

    title

    The AppBar's title.

    Declaration
    public string title { get; set; }
    Property Value
    Type Description
    string

    Methods

    AddAction(VisualElement)

    Add a new action to the AppBar.

    Declaration
    public void AddAction(VisualElement actionVisualElement)
    Parameters
    Type Name Description
    VisualElement actionVisualElement

    The action to add.

    Events

    backButtonTriggered

    Event triggered when the AppBar's back button is pressed.

    Declaration
    public event Action backButtonTriggered
    Event Type
    Type Description
    Action

    drawerButtonTriggered

    Event triggered when the AppBar's drawer button is pressed.

    Declaration
    public event Action drawerButtonTriggered
    Event Type
    Type Description
    Action

    stretchTriggered

    Event triggered when the AppBar is being stretched. The float parameter is the stretch ratio (0.0 to 1.0).

    Declaration
    public event Action<float> stretchTriggered
    Event Type
    Type Description
    Action<float>

    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)