Positron

Introduction

Build cross-platform desktop apps with React and Python

Positron

Build cross-platform desktop apps with React and Python

Positron is an Electron-like framework that lets you create desktop applications using React for the UI and Python for the backend. It uses real browser engines (WebView2/WebKit) to render your React apps natively.

from positron import App, BrowserWindow

app = App()

def create_window():
    win = BrowserWindow({'width': 800, 'height': 600})
    win.load_url('http://localhost:5173')

app.when_ready(create_window)
app.run()

Features

  • Familiar API: If you know Electron, you know Positron
  • React Support: Full support for modern React with Vite
  • Python Backend: Access to the entire Python ecosystem
  • IPC Communication: Bidirectional messaging between React and Python
  • Native Windows: Real native window management with Tkinter
  • Cross-Platform: Works on Windows, macOS, and Linux

Why Positron?

Use Python Instead of Node.js

  • Leverage Python's rich ecosystem (AI/ML, data science, automation)
  • Write backend logic in Python instead of JavaScript
  • Access native system APIs through Python

Electron-like Developer Experience

  • Same API structure as Electron
  • Hot reload during development
  • Familiar project structure

Lightweight Alternative

  • Uses system webview instead of bundled Chromium
  • Smaller bundle sizes
  • Lower memory footprint

Comparison with Electron

FeatureElectronPositron
Backend LanguageNode.jsPython
RendererChromium (bundled)System WebView
HTML/CSS SupportHTML5, CSS3HTML5, CSS3 ✅
JavaScriptFull V8Full (WebView2/WebKit) ✅
React Support✅ Full✅ Full
IPC API✅ Same API
Window API✅ Same API
App Lifecycle✅ Same API
Bundle SizeLarge (~150MB)Small (~5-10MB)
Memory UsageHighLower

Supported Technologies

Frontend (via pywebview)

  • Full React support - Modern React with hooks, ES modules, everything!
  • ✅ HTML5 / CSS3
  • ✅ Modern JavaScript (ES6+)
  • ✅ Any modern web framework (Vue, Angular, Svelte)
  • ✅ WebView2 (Windows), WebKit (macOS), GTK WebKit (Linux)

Backend (Python)

  • ✅ Any Python library
  • ✅ Machine Learning (TensorFlow, PyTorch)
  • ✅ Data Science (NumPy, Pandas)
  • ✅ Web Scraping (Requests, BeautifulSoup)
  • ✅ Automation (Selenium, PyAutoGUI)
  • ✅ Database (SQLite, PostgreSQL, MongoDB)

Roadmap

  • Core architecture (Main + Renderer processes)
  • BrowserWindow API
  • App lifecycle management
  • IPC communication
  • React/Vite integration
  • Menu API
  • Dialog API
  • Tray API
  • Notifications
  • Auto-updater
  • Application packaging
  • More examples

License

MIT License - see LICENSE file for details

Credits

Built on top of:

On this page