{"id":27865,"library":"htag","title":"htag","description":"htag is a Python GUI toolkit for building beautiful applications for mobile, web, and desktop from a single codebase, using a reactive component model similar to React. Version 2.0.27 runs on Python >= 3.10. It is actively maintained with regular releases.","status":"active","version":"2.0.27","language":"python","source_language":"en","source_url":"https://github.com/manatlan/htag","tags":["gui","web","mobile","desktop","reactive"],"install":[{"cmd":"pip install htag","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"HTag","correct":"from htag import HTag"},{"note":"Tag class is in the tag submodule; direct import from htag may fail.","wrong":"from htag import Tag","symbol":"Tag","correct":"from htag.tag import Tag"}],"quickstart":{"code":"from htag import HTag\n\nclass MyApp(HTag):\n    def init(self):\n        self += \"Hello World!\"\n\nif __name__ == \"__main__\":\n    from htag.runners import BrowserHTTP\n    BrowserHTTP(MyApp).run()","lang":"python","description":"Create a simple app that displays 'Hello World!' in the browser."},"warnings":[{"fix":"Migrate components to subclass `HTag` and define `def init(self):` instead of `__init__`.","message":"htag 2.0 dropped the old imperative API. The `HTag` class now uses a reactive pattern; components must override `init()` instead of `__init__`.","severity":"breaking","affected_versions":"2.0.0+"},{"fix":"Replace `HTag.run()` with explicit runner import, e.g., `from htag.runners import BrowserHTTP`.","message":"The `run()` method signature changed. In htag 2.x, runners require an explicit import from `htag.runners`.","severity":"breaking","affected_versions":"2.0.0+"},{"fix":"Define event handlers inside the class; use `self.bind(event, handler)` or decorate with `@HTag.event`.","message":"Event handlers must be defined as methods of the HTag subclass, not as standalone functions or lambdas in some contexts.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install or upgrade to htag >= 2.0: `pip install -U htag`, then use `from htag import HTag`.","cause":"Incorrect import path or old version (<2.0).","error":"ImportError: cannot import name 'HTag' from 'htag'"},{"fix":"Override `def init(self):` (no underscores) in your component class.","cause":"Component class defined `__init__` instead of `init`.","error":"AttributeError: 'MyApp' object has no attribute 'init'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}