Full Feature List
Global
- Can delete element via Delete key.
- Can cut/copy/duplicate/paste element via keyboard shortcut. The copied element and its children are pasted as children of the parent of the currently selected element. If nothing is selected, they are pasted at the root.
- Can cut/copy/duplicate/paste Template instances, adding the correct Template registrations to the file.
- Can copy/paste elements to and from a text file as valid UXML.
- Can undo/redo changes to styles, hierarchy, and selection.
- Open documents, the current selection, and unsaved changes survive domain reload.
- Double-clicking a
.uxml
asset in the Project opens it with UI Builder. - Previously open document is re-opened after a Unity Editor restart.
- Renaming, moving, or deleting a
.uxml
or.uss
that is currently open in the UI Builder will give you the option to abort the operation or reset the Builder and lose any unsaved changes.
StyleSheets
- Can select the main StyleSheet via the root item that should have the name of the .uss file. This displays its dedicated Inspector.
- Selectors get draggable style class pills for each selector part that is a style class name.
- In the StyleSheets pane, you can select selectors by clicking on the row or a style class pill.
- Can drag a style class pill from the StyleSheets pane onto an element in the Viewport to add the class.
- Can drag a style class pill from the StyleSheets pane onto an element in the Hierarchy to add the class.
- Dragging a style class onto an element inside a template instance or C# type in the Viewport adds it to the parent instance or C# element.
- Dragging a style class onto an element inside a template instance or C# type in the Hierarchy does nothing.
- In the toolbar of the StyleSheets pane there's a field that lets you create new selectors.
- After the field is focused, the explanation text is replaced with a default
.
and the cursor is set right after the.
to let you quickly add a class-based selector. - To commit and add your new selector, you can click on the Add button or press Enter.
- You can discover and append
:pseudoStates
from the States menu. - While the text field is selected, you should see a large tooltip displaying the selector cheatsheet.
- After the field is focused, the explanation text is replaced with a default
- When selecting or hovering over a style selector in the StyleSheets pane, all elements in the Canvas that match the selector are highlighted.
- With a selector selected, you can use standard short-cuts or the Edit menu to copy/paste/duplicate/delete it. You can also copy/paste the USS for the selector to/from a text file.
- Right-clicking anywhere in the StyleSheets pane opens the Copy/Paste/Duplicate/Delete context menu.
- Selecting an element or a the main document (VisualTreeAsset) should deselect any selected tree items in the StyleSheets pane.
Hierarchy
- The root items should display the currently loaded .uxml filename.
- Can click to select an element.
- Can drag element onto other elements in the Hierarchy to re-parent.
- Can drag an element between other elements to reorder, with live preview in the Canvas.
- Can drag an element onto other elements in the Viewport to re-parent.
- Elements are displayed using their #name in blue. If they have no name, they are displayed using their C# type in white.
- Elements are displayed grayed out if they are children of a template instance or C# type.
- Selecting an element inside a template instance or C# type displays the Inspector in read-only (disabled) mode.
- Dragging an element onto a template instance or C# type element in the Viewport re-parents it to the parent instance or C# element.
- Dragging an element onto a template instance or C# type element in the Hierarchy does nothing.
- With an element selected, you can use the standard short-cuts and Edit menu to copy/paste/duplicate/delete it. You can also copy/paste the UXML for the element to/from a text file.
- Right-clicking anywhere in the Hierarchy opens the Copy/Paste/Duplicate/Delete/Rename context menu.
- Can double-click on an item to rename it.
- Selecting an style selector or a the main StyleSheet in the StyleSheets pane should deselect any selected tree items in the Hierarchy.
Library
- Displays built-in elements under a Unity heading.
- Displays project-defined factory elements and UXML files (with
.uxml
extension) under a Project heading. This includes assets inside theAssets/
andPackages/
folders. - Can double click to create a new element instance at the root.
- Items that have corresponding
.uxml
assets have an "Open" button visible that opens the asset for editing in UI Builder. The currently open.uxml
asset in the Library is grayed out and is not instantiable to prevent infinite recursion. - Can click and drag onto a Viewport element to create new instance as a child.
- Can click and drag onto a Hierarchy element to create new instance as a child, or between elements to create as a sibling.
- Can create (double-click or drag) template instances from other
.uxml
files. - When creating a new empty VisualElement, it has an artificial minimum size and border which is reset as soon as you parent a child element under it or change its styling.
- Hovering over items in the Library shows a preview of that element in a floating preview box. The preview uses the current Theme selected for the Canvas.
- Library pane updates if new
.uxml
files are added/deleted/moved/renamed to/from the project.
Viewport
Header
- The currently open UXML asset name, or
<unsaved asset>
, is displayed in the Viewport header, grayed out. - If there are unsaved changes, a
*
is appended to the asset name. - The current UI Builder package version is displayed in the Viewport title bar.
Toolbar
- Selecting File > New clears the selection, the Viewport canvas, the StyleSheets pane, the Hierarchy, and all undo/redo stack operations for the previous document. A prompt is displayed if there are unsaved changes.
- Selecting File > Save asks for new file names for USS and UXML if it is the first save, otherwise, it overwrites the previously saved/loaded files.
- Saving should work even if the opened assets have been moved or renamed (in which case, the UI Builder should update the USS Style paths inside the UXML document).
- Selecting File > Save As... always asks for a new file name and saves as a copy of the current document.
- Selecting File > Open... displays an Open File Dialog and lets you select a
.uxml
asset inside your Project. - Dragging a
.uxml
asset onto the Object Field loads that file. - Can preview Light/Dark/Runtime themes inside the Canvas via the Theme popup field, independent from the current Editor Theme. Default Theme uses the current Editor Theme, while the other options force a theme to be used in the Canvas. If the runtime package is not installed, the Runtime theme will be substituted by the Light Editor theme.
- Pressing Preview toggles Preview mode, where you can no longer select elements by clicking them in the Viewport. Instead, Viewport elements receive regular mouse and focus events.
Save Dialog
- Entering paths that do not start with
Assets/
orPackages/
shows an invalid path message and disables the Save button. - Updating the UXML Path field automatically updates the USS Path field to match, until the USS Path field is changed manually.
- Entering file names without extensions still adds the correct extensions when creating the assets.
- The ellipsis "..." button beside each path field should bring up the system Save File Dialog.
- Folders in an otherwise valid path are created if missing.
Canvas
- Can be resized via handles on the right, left, and bottom.
- Canvas has a minimum size.
- Can click to select element.
- Selecting an element inside a template instance or C# type selects the parent instance or C# element.
- Relative position elements have bottom, right, and bottom-right handles that change inline
height
andwidth
styles. - Absolute position elements have all four side handles and all four corner handles visible.
- Absolute position elements have four anchor handles visible to set or unset the
left
/right
/top
/bottom
inline styles. - Absolute position elements can be moved by clicking and dragging, changing
top
/right
/left
/bottom
inline styles depending on anchor state. - Resize and position handles change different styles depending on anchor state (ie. if
left
andright
styles are set, changing the width changes theright
style - otherwise, changing the width changes thewidth
style). - Canvas size is restored after Domain Reload or Window reload. It is reset when opening a new document.
- When changing Width or Height in the Inspector, the corresponding resize handles in the canvas are highlighted.
- When hovering over elements in the Canvas, the corresponding entry in the Hierarchy is highlighted.
- When hovering over elements in the Canvas, all StyleSheets pane entries of style selectors that match this element are highlighted.
- If the Canvas is bigger than the Viewport, a Fit Canvas button appears that resizes the Canvas to fit in the Viewport.
- Canvas size is remembered for each asset and restored when loading the asset. It also means it survives Editor restarts.
- Clicking the root item (with the .uxml filename) in the Hierarchy displays the Canvas options in the Inspector:
- Can see and change the Canvas height and width.
- Can set the custom Canvas background color/image Opacity.
- Can set the Canvas background to be a solid color via the Color Background mode.
- Can set the Canvas background to be an image, can set the ScaleMode of the image, and can have the Canvas resize to match the image via the Fit Canvas to Image button.
- Can set the Canvas background to be a render texture for a chosen Camera.
- All of these settings are remembered next time you open the same UXML document.
Previews
UXML
- Updates text on any changes to hierarchy, attributes, or inline styles.
- Shows unsaved StyleSheet as path="*unsaved in-memory StyleSheet with...".
- Upon saving, all unsaved StyleSheet paths are fixed.
- Shows
<Style>
tags for all root elements. - The
UnityEngine.UIElements
namespace is aliased toui:
andUnityEditor.UIElements
namespace is aliased touie:
. - Custom C# elements not in the
UnityEngine.UIElements
andUnityEditor.UIElements
namespaces have no namespace alias and appear as their full type. - (2019.3+) A relative path to a
.uss
asset is used in thesrc
attribute of the<Style>
tag if the asset is in the same folder as the main asset, or a subfolder of that folder. Otherwise, an absolute path is used. - (2019.3+) A relative path to a
.uxml
asset is used in thesrc
attribute of the<Template>
tag if the asset is in the same folder as the main asset, or a subfolder of that folder. Otherwise, an absolute path is used.
USS
- Updates on all StyleSheet/Selector changes.
- Dimension (Length) styles have the unit added to the USS (
px
). (No support for%
yet.)
Inspector
StyleSheet Inspector
- Only visible if the selection is a StyleSheet (by selecting the root item in the StyleSheets pane).
- Can create new Selectors by entering text in the Selector field and pressing Enter (or the Create button).
- Shows quick help on selectors.
Style Selector Inspector
- Only visible if the selection is a selector in the current StyleSheet.
- Can change the selector text by changing the Selector field and pressing Enter.
Attributes Section
- Only visible if the selection is an element in the current document.
- Shows all valid attributes for the selected element, given its C# type.
- Attributes already set to a non-default value are highlighted with the same styling as Prefab overrides.
- Changing attributes updates the Hierarchy (or the StyleSheets pane), the Viewport, and the UXML Preview and changes are immediate.
- Right-clicking Unset on an attribute removes it from the UXML tag, resets the value to the element-defined default, and resets the override styling.
StyleSheet Section
- Only visible if the selection is an element in the current document.
- Can add existing style class to element by typing the name of the class in the field inside the StyleSheet section and pressing the Add Style Class to List button (or pressing Enter).
- Can extract all overwritten Inlined Styles to a new style class by typing the name of the class in the field inside StyleSheet and pressing the Extract Inlined Styles to New Class button.
- If the style class being added to an element is not valid, an error message appears.
- All style classes on the current element are displayed as pills.
- Style class pills have an X button that lets you remove them from the element.
- Under Matching Selectors, all matching selectors on the current element are displayed with read-only fields for their properties.
- Style class pills in the StyleSheet section show faded if there is no single-class selector in the main StyleSheet.
- Double-clicking on a style class pill in the StyleSheet section selects the corresponding single-class selector in the main StyleSheet, if one exists, otherwise it creates it.
(Inlined) Styles Section
- Only visible if the selection is an element in the current document, or a selector in the current StyleSheet (in this case, the tile will change to just Styles).
- Changing any value sets it in the StyleSheet or inline UXML style attribute and highlights it with a solid bar on the left side and bold font.
- Style category headers have an override bar and bold font if any child styles are overridden.
- All style value types are supported.
- Sub-section foldout expanded states are preserved between selection changes and domain reload.
- Right-clicking Unset on an style field removes it from the UXML inline style or StyleSheet, resets the value to default, and resets the override styling.
- Align section toggle button strips change icons depending on the value of the flex-direction style.