ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZMarkup Reference

This page is generated automatically from the executable tag registry in ZenitUI.

Basic Syntax

Construct Syntax Description
ID Tag#my_id Assigns a unique #id searchable via UINode::find("my_id") and #my_id in ZStyle.
Class Tag.cls1.cls2 Attaches one or more style classes matched by .cls1 in ZStyle.
Ref Tag@my_ref Binds a local @ref handle accessible via UINode::ref<T>("my_ref").
Quoted text Tag "Hello" Provides the element's text content (e.g. Button label, Text string, initial input value).
Attributes key="value" | flag Sets widget attributes or inline ZStyle properties. Bare flags default to "true".
Children block Tag { Child1 Child2 } Nests child elements inside the container's content target.
Prefabs & Slots MyCard { Text slot="header" "Title" } Reusable markup templates registered with registerPrefab / registerPrefabFile.

Attributes Valid on Every Tag

Any ZStyle property can be written as an inline attribute (e.g. width="100%"); see ZStyle Reference. In addition, every tag accepts:

Attribute Type Default Description
passthrough boolean false The node does not capture pointer input (events fall through).
draggable boolean false The node can start a drag & drop operation.
droppable boolean false The node can receive drops.
slot string "" Routes this child into the named Slot of the enclosing prefab.

Structural Tags

Slot

Placeholder inside a prefab replaced by the caller's children. Content between braces is the fallback.

Attribute Type Default Description
name string "" Slot name; omit for the anonymous default slot.
Slot name="header"

If

Conditional block toggled from C++ with setCondition / bindCondition. Requires an @ref.

Attribute Type Default Description
initial boolean false Initial visibility state.
If initial="true"

Each

Repeater driven from C++ with syncEach / bindEach / bindEachKeyed. Requires an @ref.

Attribute Type Default Description
prefab string "" Registered prefab instantiated for each item.
Each prefab="TaskRow"

Built-in Widgets

Stack

Generic container (Stack layout type).

C++ class: ZenitUI::Layout

Stack

Spacer

Empty node used to absorb free space (give it grow).

C++ class: ZenitUI::Layout

Spacer

VStack

Vertical flex container.

C++ class: ZenitUI::UI::VStack

VStack

HStack

Horizontal flex container.

C++ class: ZenitUI::UI::HStack

HStack

Box

Plain container with the default layout.

C++ class: ZenitUI::UI::Box

Box

Grid

2D CSS-style grid container (LayoutType::Grid).

C++ class: ZenitUI::Layout

Grid

Text

Static text.

C++ class: ZenitUI::UI::Text

Text content: the text to display

Attribute Type Default Description
wrap boolean false Wrap text onto multiple lines.
Text wrap="true"

Label

Alias of Text.

C++ class: ZenitUI::UI::Text

Text content: the text to display

Attribute Type Default Description
wrap boolean false Wrap text onto multiple lines.
Label wrap="true"

TextInput

Single-line text field (selection, clipboard, IME, undo/redo).

C++ class: ZenitUI::UI::TextInput

Text content: initial value (used when value is absent)

Attribute Type Default Description
value string "" Initial text.
placeholder string "" Hint shown while empty.
placeholder-wrap boolean false Wrap the placeholder text.

Style parts: TextInput::selection TextInput::placeholder TextInput::cursor

TextInput value="hello" placeholder="Type here" placeholder-wrap="true"

TextArea

Multi-line text editor.

C++ class: ZenitUI::UI::TextArea

Text content: initial value (used when value is absent)

Attribute Type Default Description
value string "" Initial text.
rows integer 3 Visible rows (minimum 1).
placeholder string "" Hint shown while empty.
placeholder-wrap boolean true Wrap the placeholder text.

Style parts: TextArea::selection TextArea::placeholder TextArea::cursor

TextArea value="line 1" rows="5" placeholder="Write notes" placeholder-wrap="false"

Checkbox

Checkbox.

C++ class: ZenitUI::UI::Checkbox

Attribute Type Default Description
checked boolean false Initial checked state.

Style parts: Checkbox::box Checkbox::mark

Checkbox checked="true"

ProgressBar

Progress indicator.

C++ class: ZenitUI::UI::ProgressBar

Attribute Type Default Description
value number 0 Progress in [0, 1].

Style parts: ProgressBar::track ProgressBar::fill

ProgressBar value="0.4"

Dropdown

Drop-down selector.

C++ class: ZenitUI::UI::Dropdown

Attribute Type Default Description
options list Default Comma-separated options (no escaping: an option cannot contain a comma).
selected integer 0 Initially selected index (clamped).
Dropdown options="Low, Medium, High" selected="1"

Button

Push button.

C++ class: ZenitUI::UI::Button

Text content: button label

Button "..."

Panel

Styled container.

C++ class: ZenitUI::UI::Panel

Panel

Slider

Normalized slider.

C++ class: ZenitUI::UI::Slider

Attribute Type Default Description
value number 0.5 Initial value in [0, 1].

Style parts: Slider::track Slider::fill Slider::knob

Slider value="0.25"

Toggle

On/off switch.

C++ class: ZenitUI::UI::Toggle

Attribute Type Default Description
checked boolean false Initial checked state.
Toggle checked="true"

ScrollView

Scrollable container.

C++ class: ZenitUI::UI::ScrollView

ScrollView

SplitPane

Two-pane resizable split container with a draggable divider.

C++ class: ZenitUI::UI::SplitPane

Attribute Type Default Description
orientation string horizontal Split direction: horizontal (left/right) or vertical (top/bottom).
ratio number 0.5 Initial split ratio in [0, 1] for the first pane.
splitter-size number 6 Divider thickness in pixels.
min-pane-size number 40 Minimum size in pixels for each pane.

Style parts: SplitPane::splitter

SplitPane orientation="vertical" ratio="0.35" splitter-size="8" min-pane-size="80"

TabView

Tabbed container displaying a strip of tab buttons and one active Tab page at a time.

C++ class: ZenitUI::UI::TabView

Attribute Type Default Description
selected integer 0 Initial 0-based active tab index.
position string top Tab bar placement: top or bottom.
TabView selected="0" position="bottom"

Tab

Single page inside a TabView.

C++ class: ZenitUI::UI::Tab

Attribute Type Default Description
title string "" Label shown on the corresponding tab button.
disabled boolean false When true, the tab cannot be selected.
Tab title="General" disabled="false"

TreeView

Scrollable hierarchical tree view with expandable items and keyboard navigation.

C++ class: ZenitUI::UI::TreeView

Attribute Type Default Description
indent number 18 Horizontal indentation per nesting level in pixels.
TreeView indent="20"

TreeItem

Single hierarchical node inside a TreeView or another TreeItem.

C++ class: ZenitUI::UI::TreeItem

Text content: item label (used when label is absent)

Attribute Type Default Description
label string "" Text label displayed on the row.
value string "" Optional identifier or data payload string.
expanded boolean false Initial expanded state when the item has children.
selected boolean false When true, selects this item initially inside the TreeView.
expandable boolean false Show expand arrow even when no child items are mounted yet (for lazy loading).
TreeItem label="Assets" value="assets" expanded="true" selected="false" expandable="false"

VirtualList

Virtualized list that recycles prefab instances.

C++ class: ZenitUI::UI::VirtualList

Attribute Type Default Description
prefab string "" Name of the prefab used for each row.
items integer 0 Number of rows.
row-height number 32 Fixed row height in pixels.
VirtualList prefab="LogRow" items="50000" row-height="28"

Canvas

Container for custom rendering.

C++ class: ZenitUI::UI::CanvasLayout

Canvas

Modal

Modal overlay.

C++ class: ZenitUI::UI::Modal

Modal

Popup

Anchored popup overlay.

C++ class: ZenitUI::UI::Popup

Popup

ImageContainer

Single-texture image node (bind texture from C++ via setTexture).

C++ class: ZenitUI::UI::ImageContainer

Attribute Type Default Description
fit string fill Fit mode: fill, contain, cover, none, or scale-down.
ImageContainer fit="contain"

Tooltip

Portal-based hover label.

C++ class: ZenitUI::UI::Tooltip

Text content: tooltip text

Attribute Type Default Description
delay number 0.4 Hover delay in seconds before showing.
Tooltip delay="0.3"

VirtualView

Virtualized scrolling list (bind item factory from C++ via setItemFactory).

C++ class: ZenitUI::UI::VirtualView

Attribute Type Default Description
items integer 0 Initial number of items.
uniform-height number 0 Fixed item height in pixels (0 measures each item).
VirtualView items="1000" uniform-height="32"

MenuBar

Horizontal application menu bar hosting top-level Menu dropdowns.

C++ class: ZenitUI::UI::MenuBar

MenuBar

Menu

Structured dropdown or context menu supporting shortcuts, checkable items, separators, and submenus.

C++ class: ZenitUI::UI::Menu

Attribute Type Default Description
title string "" Top-level label shown when placed inside a MenuBar.
Menu title="File"

MenuItem

Action, checkable item, or nested submenu entry inside a Menu.

C++ class: ZenitUI::UI::MenuItem

Text content: item label (used when label is absent)

Attribute Type Default Description
label string "" Text label displayed on the menu row.
shortcut string "" Optional right-aligned shortcut hint.
value string "" Optional command identifier string.
checkable boolean false When true, triggering toggles the checked state.
checked boolean false Initial checked state (enables checkable mode when true).
disabled boolean false When true, the item cannot be triggered.
MenuItem label="Save" shortcut="Ctrl+S" value="file.save" checkable="true" checked="false" disabled="false"

MenuSeparator

Horizontal divider line between entries inside a Menu.

C++ class: ZenitUI::UI::MenuSeparator

MenuSeparator

Table

Virtualized data table with sticky header, resizable columns, sorting, and row selection.

C++ class: ZenitUI::UI::Table

Attribute Type Default Description
row-height number 32 Uniform height of each virtualized body row in pixels.
header-height number 34 Height of the sticky header bar in pixels.
Table row-height="32" header-height="34"

TableColumn

Column descriptor placed inside a Table container.

C++ class: ZenitUI::UI::TableColumn

Text content: column title (used when title is absent)

Attribute Type Default Description
title string "" Column header label.
id string "" Optional column identifier string.
width number 140 Initial column width in pixels.
min-width number 48 Minimum column width allowed during drag resize.
align string start Horizontal cell alignment: start, center, or end.
sortable boolean false When true, clicking the header cycles sort order.
resizable boolean true When true, adds a draggable resize handle to the column header.
TableColumn title="Name" id="name" width="200" min-width="64" align="end" sortable="true" resizable="true"