proton-native/docs
2018-02-15 19:33:21 -05:00
..
component_APIs Merge pull request #4 from RicheyRyan/patch-3 2018-02-15 06:28:43 -05:00
images Add windows example 2018-02-11 17:01:02 -05:00
methods Remove stretchy from documentation. Fixes #6 2018-02-15 19:33:21 -05:00
SVG Add windows example 2018-02-11 17:01:02 -05:00
.nojekyll Add initial documentation, add form, and prep for tab (pass full parent, not just element) 2018-02-05 19:43:25 -05:00
_coverpage.md Fix stretchy not working 2018-02-11 20:08:44 -05:00
_sidebar.md Add Dialog docs. Docs are finished 2018-02-14 16:40:14 -05:00
CNAME Create CNAME 2018-02-09 17:08:01 -05:00
index.html Add windows example 2018-02-11 17:01:02 -05:00
js_example.js Add windows example 2018-02-11 17:01:02 -05:00
packaging.md Add windows example 2018-02-11 17:01:02 -05:00
python_example.py Add initial documentation, add form, and prep for tab (pass full parent, not just element) 2018-02-05 19:43:25 -05:00
quickstart.md Add windows example 2018-02-11 17:01:02 -05:00
README.md Add windows example 2018-02-11 17:01:02 -05:00

Proton Native

Create native desktop applications through a React syntax, on all platforms

Why?

On mobile, it used to be hard to build beatiful cross-platform apps. Then React Native came along, giving us a seamless way to build user interfaces and manage state in code, all while doing it cross platform.

On desktop, there is no such tool. You can create a GUI using something like Qt, but the code to make it is messy and unorganized. Having made a very large GUI myself, it gets very cumbersome to manage all of that.

Some of you might be saying that you could do it in Electron. It's a good tool, but it brings in a lot of overhead, running a full webbrowser to manage a small GUI, while Proton Native can do the same, using native tools, with a smaller size and with less resource usage.

Proton Native does the same to desktop that React Native did to mobile. Build cross-platform apps for the desktop, all while never leaving the React eco-system. Popular React packages such as Redux still work.

Compare this code in Qt (Python):

import sys
from PyQt5.QtWidgets import (QWidget, QToolTip, 
    QPushButton, QApplication)
from PyQt5.QtGui import QFont    


class Example(QWidget):
    
    def __init__(self):
        super().__init__()
        
        self.initUI()

    def print_hello(self):
        print("Hello")
        
        
    def initUI(self):
        btn = QPushButton('Button', self)
        btn.clicked.connect(self.print_hello)
        btn.resize(btn.sizeHint())
        btn.move(50, 50)       
        
        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('Example')    
        self.show()
        
        
if __name__ == '__main__':
    
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())

To this code using Proton Native:

import React, { Component } from 'react';

import { render, Window, App, Button } from 'proton-native';

class Example extends Component {
  render() {
    return (
      <App>
        <Window title="Example" height={300} width={300} menuBar={false}>
          <Button stretchy={false} onClicked={() => console.log('Hello')}>
            Button
          </Button>
        </Window>
      </App>
    );
  }
}

render(<Example />);

It is not only shorter, it is also easier to read and to edit, and can easily utilize the power of the state.

Features

  • Same syntax as React Native
  • Works with existing React libraries such as Redux
  • Cross platform
  • Native components. No more Electron

Examples

Check out the examples to see more.