---
title: "Public API | zenit Zig UI Docs"
description: "Tell at a glance whether a capability lives at the ui top level or in a sub-namespace."
url: https://ui.surf/zenit/docs/reference/public-api
language: en
alternate_zh: https://ui.surf/zenit/zh/docs/reference/public-api.md
alternate_es: https://ui.surf/zenit/es/docs/reference/public-api.md
alternate_ja: https://ui.surf/zenit/ja/docs/reference/public-api.md
alternate_ko: https://ui.surf/zenit/ko/docs/reference/public-api.md
alternate_fr: https://ui.surf/zenit/fr/docs/reference/public-api.md
alternate_de: https://ui.surf/zenit/de/docs/reference/public-api.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# Public API

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

`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`

```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.

| Namespace | Contents |
| --- | --- |
| `ui.widgets` | The component library: Button, Input, Modal, Tabs, VirtualList, Calendar, Notifier, FormOf… |
| `ui.fx` | Animation (Tween, Spring, Timeline), physics, Transition / SnapshotTransition, Router |
| `ui.events` | The full Event and EventResult plus key, mouse, scroll, drag and IME (ImePreeditEvent / ImeCommitEvent) payloads |
| `ui.hooks` | useHover, useFocusRing, useHoverHighlight, useAnimatedBackground, onMount / onCleanup |
| `ui.reactive` | The full reactive system: Scope, Context, StoreOf, SignalOwner, eqlValue |
| `ui.control_flow` | Show / For / Match and their option types |
| `ui.focus` | FocusManager, FocusScopeConfig, tab order |
| `ui.actions` | Action, KeyBinding, CommandBinding, ActionDispatcher |
| `ui.theme` | ThemeTokens, ColorTokens and the built-in light / dark / high\_contrast |
| `ui.icons` | The selected provider’s full icon catalog (get, all) |
| `ui.system_icons` | Provider-neutral semantic icon roles |
| `ui.assets` | The SVG Asset type and legacy common icons |
| `ui.interaction` | Interaction primitives such as RangeHoverRegistry and drag |
| `ui.select_headless` | Headless Select state machine (step, commitSelection) |
| `ui.gesture` | Gesture recognition and arbitration (Recognizer, GestureArena) |
| `ui.hit / ui.path` | Hit testing (HitQuery, HitBehavior…) and path geometry (PathCommand, Transform2D…) |
| `ui.platform_services` | Clipboard and file dialogs, taking cx.system\_sdk |
| `ui.text_shaping` | Font resolution and measurement hooks (setShapeFontResolver…) |
| `ui.console` | Per-Cx logging: Console, ScopedConsole, Level, Config, Snapshot |
| `ui.devtools` | overlay (in-window inspector), mountPanel (standalone panel), trace, source\_link |

Component props and result types are on the [component site](https://ui.surf/zenit/components); the icon list is in the [Icon Gallery](https://ui.surf/zenit/docs/guide/icons). `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

> WARNING
> 
> **Internal APIs carry no compatibility promise.** Never import from `core/`, `reactive/`, `i18n/` or other source paths directly. A new top-level namespace must be registered in the allowlist test in `ui.zig`; design a stable public surface before exposing a new capability.
