Skip to content

How rendering works ​

NitroUI Vue supplies Vue's host operations. Vue handles components, slots and reactive updates. NitroUI owns the window, native views and layout engine.

From template to native view ​

The example compiles its template with @vue/compiler-sfc and points the generated imports at @vue/runtime-core. At startup, registerApp creates a native controller, mounts a Vue app into its root view, and returns a native window for the scene.

When Vue asks the host to create a Text, the renderer allocates a NitroUI Label. Vue's text nodes become the content of that label. Fragment anchors and comments stay in the renderer's child list so a keyed update can insert a sibling in the right place.

Two trees for each window ​

A native container owns its child views. The layout engine tracks a corresponding collection of layout nodes. The renderer updates both trees on insertion, removal and moves. It coalesces layout requests into a microtask that reads the controller's current frame, solves the layout and applies the resulting frames.

Input controls also invalidate layout when their intrinsic size changes. Removing an input releases its text and layout subscriptions. Unmounting the Vue app removes the controller's size observer.

What the first version covers ​

The public components are View, Text and single-line TextInput. The example uses layout objects for sizing and spacing. Navigation, lists, CSS stylesheets and a general-purpose SFC bundler are outside this first version.

The native bindings come from the published nitro-ui-renderer/hybrids export. NitroUI 0.3.0 declares React and its reconciler as dependencies. Jolt Web is used by this documentation site.

Vue custom renderer API · NitroUI upstream

NitroUI Vue · Independent community renderer