Mold
A high-performance TUI library with a Zig core, SolidJS frontend, and blazingly fast flexbox-like layouting.
Install / Use
/learn @Adictya/MoldREADME
⚠️ OpenTui - Check out sst/opentui for a production ready solidjs terminal rendering library
Mold
A high-performance TUI library with a Zig core, SolidJS frontend, and blazingly fast flexbox-like layouting.
⚠️ Alpha Software - This is a first working proof-of-concept. Nothing is finalized.
https://github.com/user-attachments/assets/904644d5-c76d-4ce2-84bf-7e524e1af970
Features
- Zig-based core exposed via Node API using napigen
- SolidJS with HMR for reactive UI development
- Node and Bun compatible runtime support
- Blazingly fast flexbox-like layouting powered by Clay and zclay
- Wide range of terminal features thanks to libvaxis (not yet exposed/used but can easily be added):
- RGB colors, hyperlinks, bracketed paste
- Kitty keyboard protocol, fancy underlines
- Mouse shapes, system clipboard, notifications
- Images via kitty graphics protocol
Future Plans
- ShadCN-like UI library - Fully customizable and themeable terminal-first components with shadcn CLI support
- DOM-like API - Handle input/scrolling/dragging in Zig core with optional JS hooks
- Zig-based animation library - Native performance animations
- Event bus framework - Bubbles/libvaxis-like event system for component communication without prop drilling
- Declarative routing - Built-in routing system
Project Structure
./native- Zig core library./examples/solid-test- Example SolidJS application./packages/core- Core TypeScript/SolidJS bindings
Quick Start
Development (with HMR)
Requires Bun and Zig installed.
bun run build:native
bun install
cd examples/solid-test
bun run dev
Production Build
cd examples/solid-test
bun run build
node ./dist/index.js
Acknowledgements
This project builds on the excellent work of:
- Clay by Nic Barker - High-performance 2D UI layout library
- zclay by johan0A - Zig bindings for Clay
- libvaxis by rockorager - Modern TUI library for Zig
- napigen by cztomsik - Comptime N-API bindings for Zig
License
MIT
