공개 API 레퍼런스
어떤 기능이 ui 최상위에 있는지 하위 네임스페이스에 있는지 한눈에 판단할 수 있습니다.
6분 분량
src/ui/ui.zig가 공개 API의 전부입니다. 앱은 ui.*와 ui.<group>.*만 사용하며, 둘 중 어느 이름이라도 깨뜨리면 API break로 간주합니다.
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
모든 앱이 사용하는 최상위 이름을 용도별로 묶었습니다. 처음 다섯 그룹으로 대부분의 UI 파일을 다룰 수 있고, 마지막 그룹은 사용자 정의 그리기와 프레임워크 호스트용입니다.
Runtime
컨텍스트, 노드, 수명
컨텍스트, 노드, 수명
Cx · Node · Scope · Style · BoxStyle · HandlerRefBuilders
노드 생성자
노드 생성자
box · hstack · vstack · text · textFmt · image · imageTint · svg · svgTint · icon · iconTint · spacer · clickable · grid · animateNodeStyled
테마 안전 빌더와 스타일링
테마 안전 빌더와 스타일링
boxStyled · hstackStyled · vstackStyled · textStyled · iconStyled · iconTintStyled · recipe · ConditionalStyle · arb · ThemeTokens · ColorSchemeLayout
레이아웃 값 타입
레이아웃 값 타입
Sizing · Size · Point · Padding · Margin · Border · Outline · Direction · FlexWrap · AlignItems · JustifyContent · ComputedRect · GridStylePaint
색상과 페인트 효과
색상과 페인트 효과
Color · BlendMode · CornerRadius · CornerRadii · Shadow · InsetShadow · Gradient · GradientStop · MultiGradient · GradientDirection · GlassParams · GlassSurfaceText
텍스트 속성과 레이아웃 결과
텍스트 속성과 레이아웃 결과
TextProps · TextStyle · TextWrap · TextAlign · TextLayout · LineInfo · textAlignLineOffset · TextInputClient · TextInputSelectionMedia & cursor
이미지, 아이콘, 커서
이미지, 아이콘, 커서
ImageProps · IconProps · SvgAsset · CursorShape · CursorRegion · CursorToken · CustomCursorDescReactive
리액티브 기본(전체는 ui.reactive)
리액티브 기본(전체는 ui.reactive)
Signal · Memo · createEffect · createMemoControl flow
조건과 리스트(ui.control_flow에도 있음)
조건과 리스트(ui.control_flow에도 있음)
Show · For · MatchA11y
접근성 속성
접근성 속성
A11yRole · A11yProps · A11yOrientation · A11ySortDirection · A11yRect · A11yValueRangeComponents
제어 / 비제어 prop
제어 / 비제어 prop
ControlledPropAdvanced
사용자 정의 그리기, 레이아웃 콜백, 분할 작업
사용자 정의 그리기, 레이아웃 콜백, 분할 작업
DisplayItem · DrawContext · BulkQuad · AfterLayoutFn · AfterLayoutResult · max_after_layout_rounds · PointerDownFocus · Task · WorkKey · frameTier 2 · ui.<group>.X
관심사별로 묶었습니다. 기본 이상이 필요할 때 사용하세요.
네임스페이스내용
ui.widgets전체 컴포넌트 라이브러리: Button, Input, Modal, Tabs, VirtualList, Calendar, Notifier, FormOf…ui.fx애니메이션(Tween, Spring, Timeline), 물리, Transition / SnapshotTransition, Routerui.events전체 Event와 EventResult, 그리고 키·마우스·스크롤·드래그·IME(ImePreeditEvent / ImeCommitEvent) payloadui.hooksuseHover, useFocusRing, useHoverHighlight, useAnimatedBackground, onMount / onCleanupui.reactive전체 리액티브 시스템: Scope, Context, StoreOf, SignalOwner, eqlValueui.control_flowShow / For / Match와 옵션 타입ui.focusFocusManager, FocusScopeConfig, 탭 순서ui.actionsAction, KeyBinding, CommandBinding, ActionDispatcherui.themeThemeTokens, ColorTokens와 내장 light / dark / high_contrastui.icons선택한 provider의 전체 아이콘 카탈로그(get, all)ui.system_iconsprovider와 무관한 시맨틱 아이콘 역할ui.assetsSVG Asset 타입과 레거시 common 아이콘ui.interactionRangeHoverRegistry, drag 같은 인터랙션 프리미티브ui.select_headlessSelect의 headless 상태 머신(step, commitSelection)ui.gesture제스처 인식과 중재(Recognizer, GestureArena)ui.hit / ui.path히트 테스트(HitQuery, HitBehavior…)와 경로 지오메트리(PathCommand, Transform2D…)ui.platform_services클립보드와 파일 대화상자, cx.system_sdk를 인자로 받음ui.text_shaping폰트 해석과 측정 훅(setShapeFontResolver…)ui.consoleCx별 로깅: Console, ScopedConsole, Level, Config, Snapshotui.devtoolsoverlay(창 내 인스펙터), mountPanel(독립 패널), trace, source_link컴포넌트의 props와 결과 타입은 컴포넌트 사이트에, 아이콘 목록은 Icon Gallery에 있습니다. ui.a11y는 플랫폼 런타임 연결 전용이며 앱 작성자에게는 필요 없습니다. 컴포넌트의 접근성 정보는 노드의 A11yProps에 있습니다.
zenit_app
zenit_app.App은 단일 창 런타임 헬퍼로, 플랫폼·GPU·폰트 초기화와 이벤트 루프를 담당합니다. zenit_app.MultiWindowApp은 여러 개의 독립된 네이티브 창을 관리합니다(최대 16개, 넘으면 error.TooManyWindows를 반환). 같은 모듈은 WindowConfig, MultiWindowConfig, FontConfig, ResourcePath도 export합니다. 고급 호스트는 더 낮은 수준의 인터페이스를 쓸 수 있지만, 일반 앱은 여기서 시작해야 합니다.
경계
WARNING