High-performance cross-platform UI framework powered by Zig
Zylix enables you to build native applications for Web, iOS, Android, macOS, Linux, and Windows from a single codebase. Leveraging Zig's zero-cost abstractions and predictable performance, Zylix provides a Virtual DOM architecture with native platform bindings.
Documentation | Live Demo | Getting Started
- Blazing Fast - Zero-cost abstractions with Zig. No garbage collection, predictable performance.
- 7 Platforms - Web/WASM, iOS, watchOS, Android, macOS, Linux, Windows. One codebase, native performance everywhere.
- Virtual DOM - Efficient diffing algorithm for minimal updates. Only render what changes.
- Tiny Bundle - Core library under 50KB. WASM builds are incredibly small and load fast.
- Type Safe - Zig's compile-time checks catch errors before runtime. No null pointer exceptions.
- Native Bindings - C ABI for seamless integration with Swift, Kotlin, C#, and more.
| Platform | Framework | Status | Notes |
|---|---|---|---|
| Web/WASM | HTML/JavaScript | Production Ready | Full Zig core integration, JavaScript SDK |
| iOS | SwiftUI | Production Ready | ZylixSwift package with C FFI integration |
| watchOS | SwiftUI | In Development | Companion app and driver support |
| macOS | SwiftUI | Production Ready | Shares ZylixSwift package with iOS |
| Android | Jetpack Compose | In Development | UI demo only, JNI pending |
| Linux | GTK4 | In Development | Build infrastructure ready |
| Windows | WinUI 3 | In Development | Build infrastructure ready |
Note: Web/WASM and iOS/macOS platforms have full integration with the Zig core. See the Compatibility Reference for definitions and the Roadmap for details.
- Zig 0.15.0 or later
# Counter demo (minimal example)
cd samples/counter-wasm
./build.sh
python3 -m http.server 8080
# Open http://localhost:8080
# TodoMVC demo (full application)
cd samples/todo-wasm
./build.sh
python3 -m http.server 8081
# Open http://localhost:8081npm install zyliximport { init, state, todo } from 'zylix';
await init('node_modules/zylix/wasm/zylix.wasm');
// Counter operations
state.increment();
console.log(state.getCounter()); // 1
// Todo operations
todo.init();
todo.add('Learn Zylix');
console.log(todo.getCount()); // 1Each platform has its own setup requirements. See the platform documentation:
zylix/
├── core/ # Zig core library (Virtual DOM, state management, events)
├── packages/ # Published packages
│ └── zylix/ # JavaScript SDK (npm package)
├── platforms/ # Platform-specific implementations
│ ├── android/ # Kotlin/Jetpack Compose + JNI
│ ├── ios/ # Swift/SwiftUI + ZylixSwift package
│ ├── linux/ # GTK4 native app
│ ├── macos/ # SwiftUI native app
│ ├── web/ # WASM demos
│ └── windows/ # WinUI 3 implementation
├── samples/ # Working example applications
│ ├── counter-wasm/ # Minimal counter demo
│ └── todo-wasm/ # Full TodoMVC implementation
├── site/ # Documentation website (Hugo)
└── docs/ # Internal documentation
Zylix uses a layered architecture:
- Core Layer (Zig) - Virtual DOM, state management, event system, diffing algorithm
- ABI Layer (C) - Stable C interface for cross-language bindings
- Platform Layer - Native UI implementations (SwiftUI, Jetpack Compose, GTK4, WinUI 3, HTML/JS)
┌─────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────┤
│ SwiftUI │ Compose │ GTK4 │ WinUI 3 │ HTML/JS │
├───────────┴─────────┴────────┴─────────┴────────────────┤
│ C ABI Layer │
├─────────────────────────────────────────────────────────┤
│ Zylix Core (Zig) │
│ Virtual DOM │ State │ Events │ Diff │ Scheduler │
└─────────────────────────────────────────────────────────┘
# Build the core library
cd core && zig build
# Run tests
cd core && zig build test-lib --summary all
# WASM build
cd core && zig build -Dtarget=wasm32-freestanding
# iOS build (aarch64)
cd core && zig build -Dtarget=aarch64-macos
# Android build (aarch64)
cd core && zig build -Dtarget=aarch64-linux-androidThis project uses Zig 0.15.x. Key API differences from older versions:
- ArrayList API: Use
.{}for initialization, pass allocator todeinit()andappend() - Memory patterns: Structs with ArrayList fields store allocator for cleanup
- Error handling: Use explicit error handling instead of
catch {}
See CLAUDE.md for detailed Zig 0.15 patterns.
We welcome contributions! Please see our Contributing Guide for details.
If you find Zylix useful, consider supporting the project! Your support helps maintain and improve Zylix.
Feel free to buy me a coffee! Every bit of support is greatly appreciated.
Zylix is licensed under the Apache License 2.0.
- Zig Programming Language
- Hugo for documentation
- Hextra theme