Skip to content

Why GTKX ​

In a typical GTK application, code creates the widget tree and then keeps each widget in step with application state by hand: every change in state means finding the affected widgets and calling their setters. Web development moved past this years ago. Declarative components, a dev server with Fast Refresh, tests that query the interface the way a user sees it, and one-command builds are standard there, along with the React and npm ecosystems built around them.

GTKX brings that workflow to native GTK and Adwaita apps. You describe the interface in JSX; GTKX renders real Adwaita and GTK widgets, and React updates them when state changes.

Why Node.js ​

GTKX runs your app on Node.js. Node owns the process, and GTKX drives GLib's main loop, which GTK uses for input, drawing, and timers, from Node's event loop on the main thread. Your app is an ordinary Node program, so it can use Node's standard library and npm packages, and GTKX's development and test tooling builds on Vite and Vitest. GLib and Gio bindings cover platform APIs such as settings, actions, and notifications.

Platform scope ​

GTKX targets one platform, GTK and Adwaita on Linux, rather than abstracting over several. Your app uses the native libraries' own APIs, not a cross-platform subset of them. GTKX does not provide a Windows, macOS, mobile, or browser renderer. Comparisons describes how GTKX differs from GJS, node-gtk, React Native, gtk4-rs and Relm4, and Electron and Tauri.

GTKX generates TypeScript bindings from the native libraries installed for your project. Those bindings describe the available classes, methods, and JSX props. Shipping an app still requires compatible native libraries; see Deploying.

Components render native widgets, so web UI libraries that expect HTML, the DOM, or browser CSS need to be replaced or adapted. React hooks and libraries that work independently of a renderer can be reused. GTK styles use GTK CSS, whose properties and layout differ from the web.

Development tools ​

npm run dev opens your app, and Fast Refresh updates the open window as you save while preserving component state. Tests run in Vitest, find widgets by role and name, and click and type into the real native interface on a private headless display. npm run deploy builds Flatpak, Debian, RPM, and AppImage packages from your configuration; see Deploying. Coding agents can inspect and drive the running app through the MCP server.

Libraries cover common app structure: navigation maps React Navigation to native page stacks, tabs, drawers, and split views; components render collections and notifications; and forms connect native controls to React Hook Form.

Credits ​

GTKX builds on React, Vite, Vitest, napi-rs, and React Navigation. Its GObject APIs follow the names and conventions of GJS.