About HELIX
A declarative, theme-aware UI widget framework for Unity UI Toolkit.
HELIX Widgets is a declarative widget framework built on top of Unity UI Toolkit. Instead of
manipulating VisualElement trees directly, you describe your interface as a tree of
Widget objects. HELIX creates the underlying
VisualElement tree, reconciles it efficiently on rebuild, and keeps modifiers, theme values, and
state in sync automatically.
Where to start
Getting Started
Install HELIX and mount your first widget tree in a Unity UI Toolkit panel.
Widget Catalog
Browse layout, text, input, scrolling, navigation, and visual widgets.
State & Reconciliation
How widgets update, preserve state across rebuilds, and track signal dependencies.
Theming & Modifiers
Apply theme tokens, substance layers, and fluent modifier helpers.
Navigation, Scrolling & Prompts
Page stacks, scroll controllers, virtualized lists, and input prompt glyphs.
Mental model
HELIX cleanly separates configuration from runtime:
| Concept | Role |
|---|---|
| Widget | The immutable-ish configuration object you construct in C#. Think of it as a blueprint. |
| IWidgetElement | The mounted runtime element that owns a Unity VisualElement. Created once and updated in place. |
| Reconciler | Compares old and new widget trees and decides what to reuse, update, or recreate. |
| BuildContext | Passed to every Build call. Gives access to the mounted element, parent context, and theme. |
| Modifier | Small, composable style and behavior deltas applied to the underlying VisualElement. |
The mental model is intentionally similar to Flutter-style UI:
- Stateless widgets: subclasses of StatelessWidget<T> that rebuild from constructor inputs and context alone.
- Stateful widgets: subclasses of StatefulWidget<T> that own local state and expose a lifecycle (InitState, Build, DidUpdateWidget, and Dispose).
- Keys: preserve mounted element identity when children are reordered or inserted.
- Theme providers: flow values down the tree, resolved at build time through BuildContext.
A complete minimal example
The example below creates a counter label with a button. It covers stateful widgets, SetState,
the collection initializer syntax, and modifiers all in one place.
using HELIX.Types;
using HELIX.Widgets;
using HELIX.Widgets.Universal;
// The widget is a lightweight configuration object. Its sole job is to produce a State.
public class CounterLabel : StatefulWidget<CounterLabel> {
public override State<CounterLabel> CreateState() => new CounterLabelState();
}
// The state owns mutable data and implements Build.
public class CounterLabelState : State<CounterLabel> {
private int _count;
public override Widget Build(BuildContext context) {
return new HColumn(gap: 8, crossAxisAlign: Align.FlexStart) {
new HText($"Count: {_count}").Heading(context),
new HButton(onClick: SetState(() => _count++)) {
new HText("Increment")
}
}.Padding(16);
}
}Mounting the widget
Every HELIX widget tree is rooted in a WidgetHostElement.
Subclass it as a [UxmlElement] so you can drop it into UI Builder or UXML like any other element.
[UxmlElement]
public partial class MyWidgetRoot : WidgetHostElement {
public MyWidgetRoot() {
// ToBuildable() wraps the widget in the IBuildable interface the host expects.
Buildable = new CounterLabel().ToBuildable();
}
}Once the element attaches to a panel, HELIX schedules the first build automatically. After that, calls to SetState() trigger reconciled rebuilds where only the parts of the VisualElement tree that actually changed get touched.
Key API reference
The generated C# reference is available under /reference. These are the most useful anchor
points when reading the conceptual docs: