docs/reference/public-api
Reference · Surface map

Public API

Tell at a glance whether a capability lives at the ui top level or in a sub-namespace.

6 min read

src/ui/ui.zig is the entire public API: apps use only ui.* and ui.<group>.*, and breaking any name in either counts as an API break.

imports.zig
const ui = @import("ui");
const zenit_app = @import("zenit_app");

// Tier 1: straight off ui
const title = try ui.text(cx, "Hello", .{});

// Tier 2: through the group
const theme = &ui.theme.dark;
const Router = ui.fx.Router;

Tier 1 · ui.X

The top-level names every app reaches for, grouped by purpose. The first five groups cover most UI files; the last one is for custom drawing and framework hosts.

Runtime
Context, nodes and lifetime
Cx · Node · Scope · Style · BoxStyle · HandlerRef
Builders
Node constructors
box · hstack · vstack · text · textFmt · image · imageTint · svg · svgTint · icon · iconTint · spacer · clickable · grid · animateNode
Styled
Theme-safe builders and styling
boxStyled · hstackStyled · vstackStyled · textStyled · iconStyled · iconTintStyled · recipe · ConditionalStyle · arb · ThemeTokens · ColorScheme
Layout
Layout value types
Sizing · Size · Point · Padding · Margin · Border · Outline · Direction · FlexWrap · AlignItems · JustifyContent · ComputedRect · GridStyle
Paint
Color and paint effects
Color · BlendMode · CornerRadius · CornerRadii · Shadow · InsetShadow · Gradient · GradientStop · MultiGradient · GradientDirection · GlassParams · GlassSurface
Text
Text props and layout output
TextProps · TextStyle · TextWrap · TextAlign · TextLayout · LineInfo · textAlignLineOffset · TextInputClient · TextInputSelection
Media & cursor
Images, icons and cursors
ImageProps · IconProps · SvgAsset · CursorShape · CursorRegion · CursorToken · CustomCursorDesc
Reactive
Reactive essentials (full set in ui.reactive)
Signal · Memo · createEffect · createMemo
Control flow
Conditionals and lists (also ui.control_flow)
Show · For · Match
A11y
Accessibility properties
A11yRole · A11yProps · A11yOrientation · A11ySortDirection · A11yRect · A11yValueRange
Components
Controlled / uncontrolled props
ControlledProp
Advanced
Custom drawing, layout callbacks and sliced tasks
DisplayItem · DrawContext · BulkQuad · AfterLayoutFn · AfterLayoutResult · max_after_layout_rounds · PointerDownFocus · Task · WorkKey · frame

Tier 2 · ui.<group>.X

Grouped by concern. Reach for these when you need more than the basics.

NamespaceContents
ui.widgetsThe component library: Button, Input, Modal, Tabs, VirtualList, Calendar, Notifier, FormOf…
ui.fxAnimation (Tween, Spring, Timeline), physics, Transition / SnapshotTransition, Router
ui.eventsThe full Event and EventResult plus key, mouse, scroll, drag and IME (ImePreeditEvent / ImeCommitEvent) payloads
ui.hooksuseHover, useFocusRing, useHoverHighlight, useAnimatedBackground, onMount / onCleanup
ui.reactiveThe full reactive system: Scope, Context, StoreOf, SignalOwner, eqlValue
ui.control_flowShow / For / Match and their option types
ui.focusFocusManager, FocusScopeConfig, tab order
ui.actionsAction, KeyBinding, CommandBinding, ActionDispatcher
ui.themeThemeTokens, ColorTokens and the built-in light / dark / high_contrast
ui.iconsThe selected provider’s full icon catalog (get, all)
ui.system_iconsProvider-neutral semantic icon roles
ui.assetsThe SVG Asset type and legacy common icons
ui.interactionInteraction primitives such as RangeHoverRegistry and drag
ui.select_headlessHeadless Select state machine (step, commitSelection)
ui.gestureGesture recognition and arbitration (Recognizer, GestureArena)
ui.hit / ui.pathHit testing (HitQuery, HitBehavior…) and path geometry (PathCommand, Transform2D…)
ui.platform_servicesClipboard and file dialogs, taking cx.system_sdk
ui.text_shapingFont resolution and measurement hooks (setShapeFontResolver…)
ui.consolePer-Cx logging: Console, ScopedConsole, Level, Config, Snapshot
ui.devtoolsoverlay (in-window inspector), mountPanel (standalone panel), trace, source_link

Component props and result types are on the component site; the icon list is in the Icon Gallery. ui.a11y exists only for platform runtime wiring and isn’t for app authors. Component accessibility lives in a node’s A11yProps.

zenit_app

zenit_app.App is the single-window runtime helper: platform, GPU and font setup plus the event loop. zenit_app.MultiWindowApp manages several independent native windows (at most 16; beyond that you get error.TooManyWindows). The module also exports WindowConfig, MultiWindowConfig, FontConfig and ResourcePath. Advanced hosts can go lower, but ordinary apps should start here.

Boundary

zenit · Dual-licensedFree for open-source projects under GPL-3.0-only; closed-source or commercial products need a commercial license.Contact the author: zongyi.xzy#gmail.com (replace # with @)zenit 4c50245 2026-10-01