Convert Figma logo to code with AI

nodegui logoreact-nodegui

Build performant, native and cross-platform desktop applications with native React + powerful CSS like styling.🚀

6,177
171
6,177
53

Top Related Projects

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

81,614

Build smaller, faster, and more secure desktop applications with a web frontend.

Make any web page a desktop application

8,059

:zap: Native, high-performance, cross-platform desktop apps - built with Reason!

A framework for building native Windows apps with React.

164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Quick Overview

React NodeGui is a framework for building native desktop applications using React and Qt. It allows developers to create cross-platform desktop apps with JavaScript, leveraging the power of React's component-based architecture and Qt's native performance.

Pros

  • Cross-platform development for Windows, macOS, and Linux
  • Utilizes React's component-based architecture for efficient UI development
  • Offers native performance through Qt integration
  • Smaller bundle sizes compared to Electron-based applications

Cons

  • Smaller community and ecosystem compared to Electron
  • Limited documentation and learning resources
  • Potential compatibility issues with some React libraries
  • Steeper learning curve for developers unfamiliar with Qt

Code Examples

  1. Creating a basic window with a button:
import React from 'react';
import { Renderer, Window, Button } from '@nodegui/react-nodegui';

const App = () => {
  return (
    <Window windowTitle="Hello World">
      <Button text="Click me!" />
    </Window>
  );
};

Renderer.render(<App />);
  1. Handling button clicks:
import React from 'react';
import { Button, Text } from '@nodegui/react-nodegui';

const ClickCounter = () => {
  const [count, setCount] = React.useState(0);

  return (
    <>
      <Button text="Increment" on={{ clicked: () => setCount(count + 1) }} />
      <Text>{`Count: ${count}`}</Text>
    </>
  );
};
  1. Styling components:
import React from 'react';
import { View, Text } from '@nodegui/react-nodegui';

const StyledComponent = () => {
  return (
    <View
      style={`
        background-color: #f0f0f0;
        padding: 10px;
        border-radius: 5px;
      `}
    >
      <Text style="color: #333; font-size: 16px;">Styled Text</Text>
    </View>
  );
};

Getting Started

To start using React NodeGui, follow these steps:

  1. Install Node.js and npm
  2. Install the React NodeGui CLI:
    npm install -g @nodegui/react-nodegui-cli
    
  3. Create a new project:
    npx react-nodegui-cli create myapp
    
  4. Navigate to the project directory and install dependencies:
    cd myapp
    npm install
    
  5. Run the development server:
    npm run dev
    

This will set up a basic React NodeGui project and start the development server, allowing you to begin building your desktop application.

Competitor Comparisons

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Pros of Electron

  • Larger ecosystem and community support
  • Extensive documentation and resources
  • Cross-platform compatibility (Windows, macOS, Linux)

Cons of Electron

  • Higher memory usage and larger application size
  • Slower performance compared to native applications
  • Security concerns due to Chromium's attack surface

Code Comparison

Electron:

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

app.whenReady().then(createWindow)

React NodeGUI:

import React from "react";
import { Renderer, Window } from "@nodegui/react-nodegui";

const App = () => {
  return <Window style={windowStyle} />;
};

Renderer.render(<App />);

React NodeGUI offers a more lightweight alternative to Electron, focusing on native performance and smaller application size. It uses Qt under the hood, providing a native look and feel. However, Electron has a more mature ecosystem, better cross-platform support, and extensive documentation. Electron's larger community also means more third-party packages and resources are available. React NodeGUI may be preferred for performance-critical applications or when minimizing resource usage is crucial, while Electron remains a popular choice for rapid development of cross-platform desktop applications using web technologies.

81,614

Build smaller, faster, and more secure desktop applications with a web frontend.

Pros of Tauri

  • Smaller bundle sizes and better performance due to native system components
  • Supports multiple programming languages (Rust, JavaScript, TypeScript) for backend logic
  • Strong security features with automatic updates and code signing

Cons of Tauri

  • Steeper learning curve, especially for developers new to Rust
  • Less mature ecosystem compared to Electron-based solutions
  • Limited cross-platform UI consistency due to reliance on native components

Code Comparison

Tauri (main.rs):

#![cfg_attr(
  all(not(debug_assertions), target_os = "windows"),
  windows_subsystem = "windows"
)]

fn main() {
  tauri::Builder::default().run(tauri::generate_context!()).expect("error while running tauri application");
}

React NodeGUI (index.js):

import React from "react";
import { Renderer } from "@nodegui/react-nodegui";
import App from "./app";

Renderer.render(<App />);

Both frameworks aim to create desktop applications using web technologies, but Tauri leverages Rust for its core while React NodeGUI uses Node.js and Qt. Tauri offers more flexibility in language choice and better performance, while React NodeGUI provides a more familiar React-based development experience with consistent cross-platform UI.

Make any web page a desktop application

Pros of Nativefier

  • Simpler setup and usage, requiring minimal configuration
  • Supports a wide range of web applications out-of-the-box
  • Generates standalone executables for multiple platforms

Cons of Nativefier

  • Limited customization options for the generated application
  • Larger file size due to bundling Electron with each app
  • Performance may be slower compared to native applications

Code Comparison

React-NodeGUI:

import React from "react";
import { Renderer, Window, View, Text } from "@nodegui/react-nodegui";

const App = () => {
  return (
    <Window>
      <View>
        <Text>Hello, World!</Text>
      </View>
    </Window>
  );
};

Nativefier:

nativefier --name "My App" "https://example.com"

React-NodeGUI allows for more granular control over the application's UI and behavior, utilizing React components to build native desktop applications. It offers better performance and smaller file sizes due to its use of Qt instead of Electron.

Nativefier, on the other hand, provides a quick and easy way to convert web applications into desktop apps with minimal effort. It's ideal for rapid prototyping or creating simple desktop wrappers for web applications, but lacks the flexibility and performance optimizations of React-NodeGUI.

8,059

:zap: Native, high-performance, cross-platform desktop apps - built with Reason!

Pros of Revery

  • Built with OCaml, offering strong type safety and functional programming benefits
  • Leverages the ReasonML ecosystem, providing a familiar syntax for JavaScript developers
  • Supports cross-platform development for desktop and web applications

Cons of Revery

  • Smaller community and ecosystem compared to React-based solutions
  • Steeper learning curve for developers not familiar with OCaml or ReasonML
  • Limited native UI component library compared to Qt-based frameworks

Code Comparison

Revery:

let component = React.component("App");

let make = () =>
  component(hooks => {
    let (count, setCount) = React.useState(0);

    <View>
      <Text text={string_of_int(count)} />
      <Button title="Increment" onClick={() => setCount(count + 1)} />
    </View>;
  });

React NodeGui:

import React from "react";
import { View, Text, Button } from "@nodegui/react-nodegui";

function App() {
  const [count, setCount] = React.useState(0);
  return (
    <View>
      <Text>{count}</Text>
      <Button text="Increment" on={{ clicked: () => setCount(count + 1) }} />
    </View>
  );
}

Both frameworks offer similar component-based structures and state management, but Revery uses OCaml syntax while React NodeGui uses familiar JavaScript/React syntax.

A framework for building native Windows apps with React.

Pros of React Native Windows

  • Larger community and ecosystem, with more resources and third-party libraries available
  • Better integration with Windows-specific features and APIs
  • More mature and stable, with backing from Microsoft

Cons of React Native Windows

  • Heavier and more resource-intensive, potentially impacting performance
  • Steeper learning curve, especially for developers new to Windows development
  • Less flexibility in terms of customization and low-level access

Code Comparison

React Native Windows:

import React from 'react';
import { View, Text } from 'react-native';

const App = () => (
  <View>
    <Text>Hello, Windows!</Text>
  </View>
);

React NodeGui:

import React from 'react';
import { View, Text } from '@nodegui/react-nodegui';

const App = () => (
  <View>
    <Text>Hello, NodeGui!</Text>
  </View>
);

The code structure is similar, but React NodeGui uses its own set of components from the @nodegui/react-nodegui package, while React Native Windows uses components from the react-native package. Both frameworks allow developers to create native Windows applications using React, but with different underlying technologies and approaches to rendering UI components.

164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Pros of Flutter

  • Larger community and ecosystem, with more resources and third-party packages
  • Cross-platform development for mobile, web, and desktop from a single codebase
  • Hot reload feature for faster development and iteration

Cons of Flutter

  • Larger app size due to bundled runtime and dependencies
  • Steeper learning curve for developers new to Dart programming language
  • Less native look and feel compared to platform-specific UI components

Code Comparison

Flutter:

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(child: Text('Hello, World!')),
    ),
  ));
}

React NodeGui:

import React from "react";
import { Renderer, Text, Window } from "@nodegui/react-nodegui";

const App = () => {
  return <Window><Text>Hello, World!</Text></Window>;
};

Renderer.render(<App />);

Both frameworks offer declarative UI development, but Flutter uses Dart and its own widget system, while React NodeGui leverages JavaScript/TypeScript and React components. Flutter's syntax is more concise for simple apps, but React NodeGui may feel more familiar to web developers. Flutter's ecosystem is more mature, offering a wider range of pre-built components and tools for complex applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

React NodeGui

⚠️ React NodeGui is no longer maintained. Please fork it to continue development ⚠️

Join the NodeGUI community on Spectrum All Contributors

Build performant, native and cross-platform desktop applications with React.🚀

React NodeGUI is powered by React ⚛️ and Qt5 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like electron. React NodeGUI is essentially a React renderer for NodeGUI.

Visit: https://react.nodegui.org for docs.

logo

This project is in active development. It should be okay for smaller projects but anything complex - electron is the way to go for now. 🚧

How does it look?

demo_linux demo_win demo_mac
kitchendemo_macdemo_win

More screenshots?

See examples

Features

  • 🧬 Cross platform. Should work on major Linux flavours, Windows and MacOS
  • 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20mb for a hello world program.
  • 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
  • ✅ Complete Nodejs api support (Currently runs on Node v12.x - and is easily upgradable). Hence has access to all nodejs compatible npm modules.
  • 🎪 Native widget event listener support. supports all event available from Qt / NodeJs.
  • 💸 Can be used for Commercial applications.
  • 🕵️‍♂️ Good Devtools support (supports react-devtools, node debugger).
  • 📚 Good documentation and website.
  • 🧙‍♂️ Good documentation for contributors.
  • 🦹🏻‍♀️ Good support for dark mode (Thanks to QT).
  • 🏅First class Typescript support. (Works on regular JS projects too 😉).

Getting Started

Community Guides

Talks/Podcasts

Docs for contributing

Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase. You can start here:

Contributing developer docs link:

https://github.com/nodegui/nodegui/tree/master/website/docs/development

Please read: https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md

Building

npm run build

Using custom Qt

QT_INSTALL_DIR=/path/to/qt npm install

npm run build

Updating docs

npm run docs

then followed by:

cd website && GIT_USER=<your_git_username> yarn deploy

Funding

React NodeGUI is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the sponsor button on this Github repo or via Ko-Fi. Alternatively, Issues on React NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.

Buy Me a Coffee at ko-fi.com     issuehunt

Special Thanks

Code of Conduct

https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md

License

MIT

Maintainers ✨

People maintaining this project.

Atul R
Atul R

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Rahul Gaba
Rahul Gaba

💻
Kakul Gupta
Kakul Gupta

💻
Eva1ent
Eva1ent

💻
slidinghotdog
slidinghotdog

💻
Roy Sommer
Roy Sommer

💻
Natesh M Bhat
Natesh M Bhat

📖
Mikko Sairio
Mikko Sairio

💻
Shubham Zanwar
Shubham Zanwar

💻
Serhii Matrunchyk
Serhii Matrunchyk

💻
Solant
Solant

💻
Christian Petersen
Christian Petersen

💻
Adam Gastineau
Adam Gastineau

💻
gluaxspeed
gluaxspeed

💻
Chris Shepherd
Chris Shepherd

💻
Jak
Jak

💻
Greg B
Greg B

📖
Nathaniel van Diepen
Nathaniel van Diepen

💻
KR Tirtho
KR Tirtho

💻
theLMGN
theLMGN

💻
KaMeHb-UA
KaMeHb-UA

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

NPM DownloadsLast 30 Days