gtkx README

README проекта с github.com/gtkx-org/gtkx. Одним файлом markdown: README.md.

GTKX

The React framework for Linux
Adwaita and GTK 4 widgets, TypeScript, and Node.js.

npm version npm downloads Node.js version License: MPL-2.0 CI status

Homepage · Documentation · Examples · Contributing · Sponsor

GTKX brings the workflow of modern web development to native GTK and Adwaita apps: declarative UI with React, a dev server with Fast Refresh, native UI tests in Vitest, and Flatpak, Debian, RPM, and AppImage packaging. Why GTKX explains the approach, and Comparisons sets it against GJS, node-gtk, React Native, gtk4-rs and Relm4, and Electron and Tauri.

Start an app

This branch develops GTKX 2.0, currently in beta. The stable release is scheduled for 1 December 2026. For the current stable release, use the 1.x documentation.

GTKX 2.0 requires Linux, Node.js 26.7 or later, GTK 4.20 or later, libadwaita 1.8 or later, and native development libraries. Follow Getting Started to install and check them before scaffolding:

npm create gtkx@beta my-app
cd my-app
npm run dev

The native addon ships prebuilt for x64 and arm64 glibc Linux. Building it from source requires Rust and the workspace prerequisites.

Build with React

GTKX renders native Adwaita and GTK widgets. Use React state and events to update them, Node.js for filesystem and network access, and npm packages that do not require a browser DOM.

This is a complete entry point in a scaffolded app:

import {
  AdwApplication, AdwApplicationWindow,
  AdwHeaderBar, AdwToolbarView,
} from "@gtkx/jsx/adw";
import { GtkLabel } from "@gtkx/jsx/gtk";
import { createRoot, quit } from "@gtkx/react";

const App = () => (
  <AdwApplication>
    <AdwApplicationWindow title="My App" onCloseRequest={() => quit()}>
      <AdwToolbarView top={<AdwHeaderBar />}>
        <GtkLabel>Hello from GTKX</GtkLabel>
      </AdwToolbarView>
    </AdwApplicationWindow>
  </AdwApplication>
);

createRoot().render(<App />);

The CLI generates @gtkx/jsx elements and @gtkx/gi bindings from your configured native libraries. These generated packages live in your app’s node_modules.

Learn GTKX

The Notes app: an Adwaita window with a list of notes on the left and a note rendered as Markdown on the right.

The Notes app you build in the tutorial.

Packages

Apps created with create-gtkx already depend on the packages they need to run and test. Add libraries as your app needs them.

Package Description
Apps
create-gtkx Create native GTK and Adwaita apps with React and GTKX.
@gtkx/react React renderer for native GTK and Adwaita apps.
@gtkx/cli Development and packaging commands for GTK apps built with GTKX.
@gtkx/config Typed configuration for GTK apps built with GTKX.
Libraries
@gtkx/components GTK collection views, selection controls, and toasts for React.
@gtkx/css CSS-in-JS styling for GTK widgets in GTKX.
@gtkx/navigation React Navigation navigators for GTK and Adwaita apps.
@gtkx/forms React Hook Form controls for GTK and Adwaita apps.
@gtkx/animated React Spring animations for GTK widgets in GTKX.
@gtkx/i18n Gettext localization for GTK apps through react-i18next.
@gtkx/cairo Cairo drawing for GTK apps built with GTKX.
@gtkx/gl OpenGL 4.6 core bindings for GTK GL areas in GTKX.
Testing and tools
@gtkx/testing Test GTKX apps against real GTK widgets.
@gtkx/vitest Vitest plugin that runs GTK tests in isolated headless displays.
@gtkx/storybook Native Adwaita explorer for Storybook stories of GTKX components.
@gtkx/mcp MCP server that inspects running GTKX apps and their generated bindings.
Bindings and internals
@gtkx/codegen Generate TypeScript and JSX bindings for GTK and GObject libraries.
@gtkx/runtime Runtime for generated GTK and GObject Introspection bindings in GTKX.
@gtkx/native Node.js addon that calls GTK and other C libraries for GTKX.
@gtkx/utils Shared Node.js utilities used by GTKX packages.

Contribute

See CONTRIBUTING.md for setup and checks, the Code of Conduct, and the security policy. Architecture and maintainer procedures are in the contributor docs.

Support GTKX

Contribute through Open Collective to help cover recurring costs. Our funding plan explains expenses, fees, and the operating reserve.

Credits

Why GTKX credits the projects GTKX builds on.

License

MPL-2.0.

gtkx (gtkx-org/gtkx)

Ищем в базе…

Что это такое?GTKX — фреймворк для создания нативных десктопных приложений Linux на React и TypeScript, который отрисовывает настоящие виджеты Adwaita и GTK4 вместо интерфейса на базе браузера.
Это обёртка над UI-тулкитом или полноценный рендерер React?GTKX — полноценный React-реконсилер: состояние и события React напрямую управляют нативными виджетами Adwaita/GTK, а для доступа к файловой системе и сети используется Node.js вместо браузерного DOM.
Как запустить приложение?Установите необходимые нативные библиотеки, затем создайте каркас проекта с помощью GTKX CLI, который также генерирует элементы @gtkx/jsx и привязки @gtkx/gi локально для вашего приложения, а не подтягивает их из npm.
Что нужно установить перед началом?Нужны Linux, Node.js 26.7 или новее, GTK 4.20 или новее, libadwaita 1.8 или новее и библиотеки нативной разработки; для целей за пределами предсобранного x64/arm64 glibc Linux также потребуется собрать нативный аддон с помощью Rust.
Готово ли это к использованию в продакшене?Эта ветка — GTKX 2.0, сейчас в бете, стабильный релиз запланирован на 1 декабря 2026 года, так что до этого момента стоит ожидать изменений.
Что такое Adwaita и почему это здесь важно?Adwaita — нативная дизайн-система и набор виджетов GNOME; GTKX отрисовывает настоящие виджеты Adwaita/GTK4, поэтому приложения выглядят и ведут себя как нативное ПО Linux, а не как встроенный просмотр браузера.
Можно ли использовать обычные npm-пакеты с GTKX?Да, подойдёт любой npm-пакет, которому не нужен браузерный DOM, поскольку приложения GTKX работают на Node.js с обычным доступом к файловой системе и сети.
Чему можно научиться из официального туториала?В документации шаг за шагом разбирается создание приложения для задач от начала до конца: формы, навигация, анимация, стилизация, тестирование и упаковка для распространения.
Какие есть похожие проекты?juhradial-mx, hearthstone-linux-gui, penguin-mail, gpui-kit, native, omarchy-meeting-recorder, wails, nsh
Автор
gtkx-org
Размер
81.9 MB
Звёзды
495
Возраст
1 г
Коммиты · 90 дней