Skip to content
Projets

À propos

react Native bridge for gtk desktop applications

Développement web et applicatif

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

react-gtk

Financial Contributors on Open Collective

build native desktop applications with react and gtk4

react-gtk is a react renderer for GTK 4. It drives real GTK widgets through node-gtk (GObject Introspection bindings for Node.js), supports flexbox layout via Yoga, and styles widgets with CSS-like style props.

JOIN DISCORD

This project is under active development. Please help by sharing your experience, bugs, comments, complaints, etc . . .

If you think it, say it :laughing:

Usage

import React from 'react';
import Gtk from '@girs/node-gtk-4.0';
import { Box, Button, render } from '@react-gtk/core';

function App() {
  return (
    <Box orientation={Gtk.Orientation.VERTICAL}>
      <Button
        label="Click Me!"
        onClicked={() => {
          console.log('button was clicked');
        }}
      />
    </Box>
  );
}

render(<App />);

Dependencies

Ubuntu

sudo apt install libgtk-4-dev libgirepository1.0-dev gobject-introspection

macOS

brew install gtk4 gobject-introspection

Development

The repo is a pnpm workspace wrapped in make. The toolchain is pinned in .tool-versions (asdf).

make prepare    # one-time machine setup (asdf toolchain + pnpm install)
make build      # generate widget bindings and build the packages
make test       # run the unit tests
make typecheck  # typecheck every workspace package
make lint       # oxlint
make format     # oxfmt

The widget elements in @react-gtk/core are generated from your system's Gtk-4.0.gir by @react-gtk/generate (see packages/core/src/generated, which is gitignored). If your gir files live somewhere unusual, point the generator at them with the GIR_DIRECTORIES environment variable (path-delimiter separated).

Run the examples with a working GTK 4 installation:

make examples/todo/dev

note: running apps (as opposed to building the packages) requires the node-gtk native binding. pnpm skips dependency build scripts by default, so allow it with pnpm approve-builds if you need the runtime.

Packages

package description
@react-gtk/core the react renderer and generated widget elements
@react-gtk/generate generates widget elements from gir files

Support

Submit an issue

Contributing

Become a financial contributor and help us sustain our community. [Contribute]

License

Apache-2.0

BitSpur (c) Copyright 2017 - 2026

Explorer des projets similaires

Chargement…