skillfed

htag

Python3 GUI toolkit for building 'beautiful' applications for mobile, web, and desktop from a single codebase

htag v2.0.28 134.7K downloads/30d#11,465 on PyPI111
Permissive license MIT Active released

What it is and what it does

htag is a reactive Python GUI framework that lets you write web, desktop, and mobile applications using a single codebase. It provides HTML-like components (Tag.div, Tag.button, etc.) with a Python-native API, state management via reactive State objects, and automatic UI synchronization. The framework handles communication via WebSocket with graceful fallbacks to HTTP SSE and pure HTTP, making it suitable for environments with restrictive network policies.

Applications are built as component trees using declarative syntax with context managers, scoped CSS styles, and event handling. It integrates with starlette/FastAPI for web deployment, runs as a ChromeApp for desktop, and supports PyScript for SPA HTML pages. The framework emphasizes developer experience with hot-reload, better error handling, and minimal boilerplate compared to its v1 predecessor.

Use it for:

  • Build a web dashboard that runs on starlette/FastAPI with real-time updates via WebSocket, falling back to HTTP polling in restricted networks.
  • Create a cross-platform desktop application using ChromeApp that works on Linux, Windows, and macOS from the same Python codebase.
  • Develop a single-page application (SPA) using PyScript that runs entirely in the browser without a Python backend.
  • Build a mobile-first web app with reactive state management and scoped component styles for responsive design.
  • Prototype interactive data visualization or admin tools quickly with minimal boilerplate and automatic UI reactivity.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

htag is a Python GUI toolkit for building web, desktop, and mobile applications from a single codebase using reactive components and HTML-like syntax.

Yes, if you want to build web or desktop GUIs in Python with a modern reactive framework and cross-platform support. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Verify that the fallback communication modes and Android support meet your specific deployment requirements before committing to production use.

Install

htag on PyPI

pip

pip install htag

uv

uv add htag

poetry

poetry add htag

Installing htag

Before you install

Low install friction with a pure-Python wheel. Active maintenance with a recent release (43 days old) and steady repository activity. Requires Python 3.10 or later and depends on starlette, uvicorn, and websockets for runtime.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.

Quickstart

pip install -U htag

from htag import Tag

class App(Tag.App):
    def render(self):
        return Tag.div("Hello, htag")

from htag.runners import ChromeApp
ChromeApp(App).run()

Requires Python 3.10 or later. Desktop runners (ChromeApp) need a browser environment; web deployment requires starlette or FastAPI.

Verify before relying

  • Whether the framework's hot-reload and fallback communication modes (WebSocket → HTTP SSE → pure HTTP) work reliably in production environments with strict network policies.
  • Performance characteristics and scalability limits for applications with many concurrent users or complex component trees.
  • Maturity and stability of Android app building support, given the description notes it 'needs to improve'.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — starlette, uvicorn, websockets
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 134,706/month — #11,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: htag-2.0.28-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Software Development :: User Interfaces

Tags

python gui framework web desktopreactive ui toolkit cross-platformhtml component framework pythonweb app builder single codebasepython frontend frameworkstarlette asgi gui toolkitwebsocket reactive components
reactive-uicross-platformweb-framework

More User Interfaces packages