# UIDocument

> Defines a Component that connects VisualElements to GameObjects. This makes it possible to render UI defined in UXML documents in the Game view.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Inherits from:** [MonoBehaviour](/engine/6000.0/script-reference/unityengine/monobehaviour.md)

```csharp
[HelpURL("UIE-get-started-with-runtime-ui")]
[AddComponentMenu("UI Toolkit/UI Document")]
[DefaultExecutionOrder(-100)]
public sealed class UIDocument : MonoBehaviour
```

## Properties

| Property                                                                                                    | Description                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [panelSettings](/engine/6000.0/script-reference/unityengine/uielements/uidocument/panelsettings.md)         | Specifies the PanelSettings instance to connect this UIDocument component to.                                                                                                                                                                        |
| [parentUI](/engine/6000.0/script-reference/unityengine/uielements/uidocument/parentui.md)                   | If the GameObject that this UIDocument component is attached to has a parent GameObject, and that parent GameObject also has a UIDocument component attached to it, this value is set to the parent GameObject's UIDocument component automatically. |
| [rootVisualElement](/engine/6000.0/script-reference/unityengine/uielements/uidocument/rootvisualelement.md) | The root visual element where the UI hierarchy starts.                                                                                                                                                                                               |
| [runtimePanel](/engine/6000.0/script-reference/unityengine/uielements/uidocument/runtimepanel.md)           | The runtime panel that this UIDocument is attached to.                                                                                                                                                                                               |
| [sortingOrder](/engine/6000.0/script-reference/unityengine/uielements/uidocument/sortingorder.md)           | The order in which this UIDocument will show up on the hierarchy in relation to other UIDocuments either attached to the same PanelSettings, or with the same UIDocument parent.                                                                     |
| [visualTreeAsset](/engine/6000.0/script-reference/unityengine/uielements/uidocument/visualtreeasset.md)     | The [VisualTreeAsset](/engine/6000.0/script-reference/unityengine/uielements/visualtreeasset.md) loaded into the root visual element automatically.                                                                                                  |

## Inheritance

**Inherited Members:**

* [MonoBehaviour.IsInvoking()](/engine/6000.0/script-reference/unityengine/monobehaviour/isinvoking.md#isinvoking\(\))
* [MonoBehaviour.CancelInvoke()](/engine/6000.0/script-reference/unityengine/monobehaviour/cancelinvoke.md#cancelinvoke\(\))
* [MonoBehaviour.Invoke(string, float)](/engine/6000.0/script-reference/unityengine/monobehaviour/invoke.md)
* [MonoBehaviour.InvokeRepeating(string, float, float)](/engine/6000.0/script-reference/unityengine/monobehaviour/invokerepeating.md)
* [MonoBehaviour.CancelInvoke(string)](/engine/6000.0/script-reference/unityengine/monobehaviour/cancelinvoke.md#cancelinvoke\(string\))
* [MonoBehaviour.IsInvoking(string)](/engine/6000.0/script-reference/unityengine/monobehaviour/isinvoking.md#isinvoking\(string\))
* [MonoBehaviour.StartCoroutine(string, Object)](/engine/6000.0/script-reference/unityengine/monobehaviour/startcoroutine.md#startcoroutine\(string-object\))
* [MonoBehaviour.StartCoroutine(IEnumerator)](/engine/6000.0/script-reference/unityengine/monobehaviour/startcoroutine.md#startcoroutine\(ienumerator\))
* [MonoBehaviour.StopCoroutine(IEnumerator)](/engine/6000.0/script-reference/unityengine/monobehaviour/stopcoroutine.md#stopcoroutine\(ienumerator\))
* [MonoBehaviour.StopCoroutine(Coroutine)](/engine/6000.0/script-reference/unityengine/monobehaviour/stopcoroutine.md#stopcoroutine\(coroutine\))
* [MonoBehaviour.StopCoroutine(string)](/engine/6000.0/script-reference/unityengine/monobehaviour/stopcoroutine.md#stopcoroutine\(string\))
* [MonoBehaviour.StopAllCoroutines()](/engine/6000.0/script-reference/unityengine/monobehaviour/stopallcoroutines.md)
* [MonoBehaviour.print(Object)](/engine/6000.0/script-reference/unityengine/monobehaviour/print.md)
* [MonoBehaviour.destroyCancellationToken](/engine/6000.0/script-reference/unityengine/monobehaviour/destroycancellationtoken.md)
* [MonoBehaviour.useGUILayout](/engine/6000.0/script-reference/unityengine/monobehaviour/useguilayout.md)
* [MonoBehaviour.didStart](/engine/6000.0/script-reference/unityengine/monobehaviour/didstart.md)
* [MonoBehaviour.didAwake](/engine/6000.0/script-reference/unityengine/monobehaviour/didawake.md)
* [MonoBehaviour.runInEditMode](/engine/6000.0/script-reference/unityengine/monobehaviour/runineditmode.md)
* [Behaviour.enabled](/engine/6000.0/script-reference/unityengine/behaviour/enabled.md)
* [Behaviour.isActiveAndEnabled](/engine/6000.0/script-reference/unityengine/behaviour/isactiveandenabled.md)
* [Component.GetComponent(Type)](/engine/6000.0/script-reference/unityengine/component/getcomponent.md#getcomponent\(type\))
* [Component.GetComponent\<T>()](/engine/6000.0/script-reference/unityengine/component/getcomponent.md)
* [Component.TryGetComponent(Type, Component)](/engine/6000.0/script-reference/unityengine/component/trygetcomponent.md)
* [Component.TryGetComponent\<T>(T)](/engine/6000.0/script-reference/unityengine/component/trygetcomponent.md)
* [Component.GetComponent(string)](/engine/6000.0/script-reference/unityengine/component/getcomponent.md#getcomponent\(string\))
* [Component.GetComponentInChildren(Type, bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentinchildren.md#getcomponentinchildren\(type-bool\))
* [Component.GetComponentInChildren(Type)](/engine/6000.0/script-reference/unityengine/component/getcomponentinchildren.md#getcomponentinchildren\(type\))
* [Component.GetComponentInChildren\<T>(bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentinchildren.md)
* [Component.GetComponentsInChildren(Type, bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinchildren.md)
* [Component.GetComponentsInChildren\<T>(bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinchildren.md#getcomponentsinchildrent\(bool\))
* [Component.GetComponentsInChildren\<T>(bool, List\<T>)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinchildren.md)
* [Component.GetComponentsInChildren\<T>()](/engine/6000.0/script-reference/unityengine/component/getcomponentsinchildren.md#getcomponentsinchildrent\(\))
* [Component.GetComponentsInChildren\<T>(List\<T>)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinchildren.md)
* [Component.GetComponentInParent(Type, bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentinparent.md#getcomponentinparent\(type-bool\))
* [Component.GetComponentInParent(Type)](/engine/6000.0/script-reference/unityengine/component/getcomponentinparent.md#getcomponentinparent\(type\))
* [Component.GetComponentInParent\<T>(bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentinparent.md#getcomponentinparentt\(bool\))
* [Component.GetComponentInParent\<T>()](/engine/6000.0/script-reference/unityengine/component/getcomponentinparent.md#getcomponentinparentt\(\))
* [Component.GetComponentsInParent(Type, bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinparent.md)
* [Component.GetComponentsInParent\<T>(bool)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinparent.md#getcomponentsinparentt\(bool\))
* [Component.GetComponentsInParent\<T>(bool, List\<T>)](/engine/6000.0/script-reference/unityengine/component/getcomponentsinparent.md)
* [Component.GetComponentsInParent\<T>()](/engine/6000.0/script-reference/unityengine/component/getcomponentsinparent.md#getcomponentsinparentt\(\))
* [Component.GetComponents(Type)](/engine/6000.0/script-reference/unityengine/component/getcomponents.md#getcomponents\(type\))
* [Component.GetComponents(Type, List\<Component>)](/engine/6000.0/script-reference/unityengine/component/getcomponents.md#getcomponents\(type-listcomponent\))
* [Component.GetComponents\<T>(List\<T>)](/engine/6000.0/script-reference/unityengine/component/getcomponents.md)
* [Component.GetComponents\<T>()](/engine/6000.0/script-reference/unityengine/component/getcomponents.md#getcomponentst\(\))
* [Component.GetComponentIndex()](/engine/6000.0/script-reference/unityengine/component/getcomponentindex.md)
* [Component.CompareTag(string)](/engine/6000.0/script-reference/unityengine/component/comparetag.md#comparetag\(string\))
* [Component.CompareTag(TagHandle)](/engine/6000.0/script-reference/unityengine/component/comparetag.md#comparetag\(taghandle\))
* [Component.SendMessageUpwards(string, Object, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/sendmessageupwards.md#sendmessageupwards\(string-object-sendmessageoptions\))
* [Component.SendMessageUpwards(string, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/sendmessageupwards.md#sendmessageupwards\(string-sendmessageoptions\))
* [Component.SendMessage(string, Object)](/engine/6000.0/script-reference/unityengine/component/sendmessage.md#sendmessage\(string-object\))
* [Component.SendMessage(string)](/engine/6000.0/script-reference/unityengine/component/sendmessage.md#sendmessage\(string\))
* [Component.SendMessage(string, Object, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/sendmessage.md#sendmessage\(string-object-sendmessageoptions\))
* [Component.SendMessage(string, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/sendmessage.md#sendmessage\(string-sendmessageoptions\))
* [Component.BroadcastMessage(string, Object, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/broadcastmessage.md#broadcastmessage\(string-object-sendmessageoptions\))
* [Component.BroadcastMessage(string, SendMessageOptions)](/engine/6000.0/script-reference/unityengine/component/broadcastmessage.md#broadcastmessage\(string-sendmessageoptions\))
* [Component.transform](/engine/6000.0/script-reference/unityengine/component/transform.md)
* [Component.gameObject](/engine/6000.0/script-reference/unityengine/component/gameobject.md)
* [Component.tag](/engine/6000.0/script-reference/unityengine/component/tag.md)
* [Object.GetInstanceID()](/engine/6000.0/script-reference/unityengine/object/getinstanceid.md)
* [Object.GetHashCode()](/engine/6000.0/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/6000.0/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/6000.0/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectssortmode\))
* [Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive-findobjectssortmode\))
* [Object.DontDestroyOnLoad(Object)](/engine/6000.0/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindObjectsByType\<T>(FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectssortmode\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive-findobjectssortmode\))
* [Object.FindFirstObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindFirstObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindFirstObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindFirstObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type-findobjectsinactive\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/6000.0/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/6000.0/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/6000.0/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/6000.0/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/6000.0/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/6000.0/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
