ztk

Tk, rebuilt in Zig. ztk runs Tk scripts on the ztcl interpreter, with a GPU renderer, a modern look from CSS, smooth animation, and a WebAssembly build for the browser.

Docs and live demos: https://beetlebug.org/ztk/

The widget gallery drawn by ztk: buttons, switches, radio buttons, entries, a scale, ttk widgets, and a canvas in cards

Install

npm install @beetlebug/ztk     # for the web

Install has the release binaries and the build from source.

Example

ttk::label .title -text "Hello from ztk"
ttk::entry .name -textvariable name
ttk::button .greet -text "Greet" -style Accent.TButton -command {set msg "Hello, $name!"}
ttk::label .msg -textvariable msg
pack .title .name .greet .msg -padx 12 -pady 4 -anchor w
ttk::style configure Accent.TButton -foreground white -background #2563eb
ztk hello.tcl

Documentation

Status

ztk is experimental, and it is not yet a drop-in Tk. Differences from Tk lists what is missing, such as send and the selections and clipboard of the system. The code and the docs were written largely with AI coding agents, under human direction. Review the code before you depend on it. The plan has the roadmap, and the issues take bug reports and requests.

Contact

Write to opensource@beetlebug.org about ztk. Open an issue for a bug or a request, and report a security problem as SECURITY.md says.

License

BSD-2-Clause. See LICENSE. ztk has no code of Tk. References credits Tk and the other sources.