Native SDK Examples

August 14, 2026 · View on GitHub

Most examples here are zero-config apps: app.zon + src/ (+ assets/) and nothing else. The native CLI owns their build — run any of them straight from its directory:

native dev     # build and run with hot reload
native test    # run the app's test suite
native build   # produce a ReleaseFast binary in zig-out/bin/

(In this repository the CLI is zig-out/bin/native, built by zig build at the root.) A handful of examples own a build.zig because they genuinely outgrow the generated graph — each one's build file opens with the reason.

Start here: TypeScript + Native markup

TypeScript is the primary app-authoring language. A new native init my_app project has src/core.ts, src/app.native, and app.zon; the core compiles ahead of time to native code, so no JS runtime ships in the app. These examples are the clearest substantial references for that path:

ExampleShows
chatbotMulti-module TypeScript core, text editing, streaming Cmd.fetch, environment messages, and deterministic replay.
service-feed-readerThe complete services loop: Cmd.fetch, a parsing service reached through the generated @native-sdk/services client, shared record shapes, and recorded replay without the service.
relational-notesAppend-only SQLite migrations, build-time checked SQL, generated typed transactions and page decoders, FTS5, and live queries.
gpu-componentsIsolated interactive Native UI specimens, disclosure trees, anchored menus, and controlled component state.
soundboard-tsFull music player: audio effects, timers, search, assets, native context menus, and adaptive markup.
system-monitor-tsSubprocess effects, timers, parsing, tables, charts, controlled scroll, and confirmation flows.

The -ts suffix is historical: soundboard-ts and system-monitor-ts distinguish ports from older Zig originals in the same catalog. Chatbot was introduced as a TypeScript-only example and follows the unsuffixed default. New TypeScript apps need no suffix because TypeScript is the default. Many unsuffixed showcase apps predate that default and still use src/main.zig; use them for their feature or visual patterns, not as evidence that new app logic should be Zig.

Earlier native-rendered showcase apps (Zig cores)

ExampleShows
habitsThe smallest markup app: one .native view, a plain-form Model/Msg/update.
calculatorA complete small app: markup keypad, text-field keyboard path, chrome shortcuts, theming.
notesPersistence through the effects channel: debounced writes, restore on boot, dialogs, search.
kanbanBuilder-view boards with drag interactions.
feedWindowed 100k-row list virtualization with runtime-owned scrolling.
soundboardAlbum grid with decoded cover art, context menus, timers, and a custom theme.
deckTwo model-declared windows and a dense track ledger.
markdown-viewerReal file I/O through effects, hidden-inset titlebar retrofit, preview + editor.
code-editorPlatform folder picker, bounded filesystem tree, and syntax-highlighted source editor.
system-monitorLive process sampling, confirmation dialogs, a settings window.
gpu-surfaceA Metal-backed GPU surface composed beside native controls and WebView content.
gpu-dashboardNative chrome, a GPU surface, and a retained canvas display list.
canvas-previewCanvas + WebView in one window, panes snapped to canvas anchors, a status item.
effects-probeThe effect system live: spawn/fetch/file effects, cancellation, worker wakes.
menu-barThe menu-bar app lifecycle: close_policy = "hide", a status item whose Open/Quit rows drive fx.showWindow/fx.quitApp, Dock reopen.

Examples that own their build

ExampleWhy it keeps a build.zig
helloSmallest WebView shell, with the SDK module wiring spelled out by hand.
webviewBridge commands, window APIs, security policy, automation, and optional CEF engine flags.
command-appOne command routed from toolbar, menu, tray, shortcut, and bridge entry points.
capabilitiesGuarded OS services: notifications, clipboard, credentials, dialogs, file drops.
native-shellNative toolbar/sidebar/statusbar chrome around a WebView content area.
native-panelsSplit native panels and stacked native controls around WebView content.
browserLayered WebViews for isolated page content, engine link flags wired by hand.
next, react, svelte, vueFrontend projects with managed install/build/dev-server steps.
ui-inboxThe builder-view inbox; its -Dmobile lib step feeds the mobile host shims.
mobile-canvasBuilds the mobile embed static library consumed by the iOS/Android canvas shims.

mobile-shell, ios, and android are mobile host projects (Xcode/Gradle shells plus shared app.zon metadata) rather than desktop app directories.

Start with native init for a small TypeScript + Native markup app, then use chatbot, gpu-components, soundboard-ts, or system-monitor-ts according to the feature you need. Use habits when you specifically want the smallest Zig-core equivalent, hello for the lower-level WebView path, webview for native commands or WebView policy, capabilities for guarded OS services, and gpu-surface or gpu-dashboard for custom-rendered or retained-canvas panes.