Brand new to UI Toolkit? Two-minute orientation, then you'll know what you're looking at on every page from here on.
UI Toolkit (UITK) is Unity's newer UI system, shipped with every install of Unity 6 — Luna is built on top of it.
Unity actually ships two UI systems: the old one (uGUI, GameObject + RectTransform based) and the new one (UI Toolkit, web-tech inspired). UITK is the future direction; Luna only targets UITK.
UITK is a Unity reimplementation of the same three-layer split the web uses:
| Web | UI Toolkit | What it does |
|---|---|---|
| HTML | UXML | Describes the visual tree — <Button>, <Label>, layout containers. |
| CSS | USS | Styles those elements — colors, sizes, fonts, hover states. |
| DOM | VisualElement | The runtime tree your C# code reaches into. |
| JS | C# | Behavior — click handlers, dynamic state, events. |
If "selectors, classes, flexbox, :hover" already mean something to you, you'll feel at home. UITK supports all of that and uses similar syntax.
.uxml file is the layout — a hierarchy of UI elements (buttons, labels, containers) written in XML markup. You can hand-write it or design it visually in Unity's UI Builder window..uss file is the stylesheet — rules like "every element named submit-btn is purple with rounded corners". One rule can style hundreds of elements.UIDocument MonoBehaviour drops a UXML tree into a scene — pick a UXML asset, pick a Panel Settings asset, done.VisualElement is the runtime object your C# code interacts with — query it, hook click events, toggle classes.That's the whole mental model. The rest is detail.
uGUI gave every UI element its own GameObject. A complex menu could spawn hundreds of them, each with a RectTransform, each affected by the scene hierarchy, each costing CPU per frame. Styling required custom scripts — there was no global "all my buttons look like this" mechanism.
UITK fixes that:
VisualElement is not a GameObject. Hundreds of them barely register on the profiler.When you import Luna's samples in a few minutes, you'll encounter these file types:
.uxml — the layout files (open in UI Builder, double-click to launch)..uss — stylesheets (open in any text editor; Luna ships a utility-class set like Tailwind)..tss — Theme Stylesheet, a special USS used as the root theme. Luna ships one; you assign it via Panel Settings.UIViewComponent — Luna's MonoBehaviour wrapping UIDocument with fade transitions, focus management, and input wiring.You don't need to memorize this. Every page from here on assumes you know what UXML and USS are, which you now do.
Settings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction