docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TextArea

    Text Area UI element.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    ExVisualElement
    TextArea
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<string>
    IValidatableElement<string>
    INotifyValueChanging<string>
    INotifyValueChanged<string>
    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 TextArea : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<string>, IValidatableElement<string>, INotifyValueChanging<string>, INotifyValueChanged<string>

    Constructors

    TextArea()

    Default constructor.

    Declaration
    public TextArea()

    TextArea(string)

    Construct a TextArea with a predefined text value. No event will be triggered when setting the text value during construction.

    Declaration
    public TextArea(string value)
    Parameters
    Type Name Description
    string value

    A default text value.

    Fields

    inputUssClassName

    The TextArea input styling class.

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

    placeholderUssClassName

    The TextArea placeholder styling class.

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

    resizeHandleUssClassName

    The TextArea resize handle styling class.

    Declaration
    public const string resizeHandleUssClassName = "appui-textarea__resize-handle"
    Field Value
    Type Description
    string

    scrollViewUssClassName

    The TextArea input container styling class.

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

    ussClassName

    The TextArea main styling class.

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

    Properties

    autoResize

    Automatically resize the TextArea if the content is larger than the current size.

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

    This will only grow the TextArea. It will not shrink it.

    contentContainer

    The content container of the TextArea.

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

    invalid

    The invalid state of the TextArea.

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

    isReadOnly

    Whether the TextArea is read-only.

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

    maxLength

    The maximum length of the TextArea.

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

    placeholder

    The TextArea placeholder text.

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

    submitModifiers

    The modifiers required to submit the TextArea.

    Declaration
    public EventModifiers submitModifiers { get; set; }
    Property Value
    Type Description
    EventModifiers

    submitOnEnter

    Whether the TextArea should invoke the submitted event when the user presses the Enter key.

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

    validateValue

    The validation function for the TextArea.

    Declaration
    public Func<string, bool> validateValue { get; set; }
    Property Value
    Type Description
    Func<string, bool>

    value

    The TextArea value.

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

    Methods

    SetValueWithoutNotify(string)

    Set the TextArea value without notifying the change.

    Declaration
    public void SetValueWithoutNotify(string newValue)
    Parameters
    Type Name Description
    string newValue

    The new value of the TextArea.

    Events

    submitted

    Event triggered when the user presses the Enter key and submitOnEnter is true.

    Declaration
    public event Action submitted
    Event Type
    Type Description
    Action

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<TValueType>
    IValidatableElement<TValueType>
    INotifyValueChanging<TValueType>
    INotifyValueChanged<T>

    Extension Methods

    NotifyValueChangingExtensions.RegisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    NotifyValueChangingExtensions.UnregisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    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)