Skip to main content

AffineUI for Python

AffineUI running the Dender 3D-print slicer — the default Decius CSS look AffineUI rendering a Bootstrap dashboard

A small, HTML5-compliant, GPU-accelerated UI renderer with an integrated component framework — a native replacement for Electron and Qt, for Python.

Think Gradio, but native: describe your UI as a tree of typed components, get a real HTML/CSS renderer with a browser-quality cascade, animations, hit-testing, and 120 Hz paint — all in one binary, no browser embedded, no JavaScript runtime, no Electron. Bootstrap and Tailwind-style stylesheets render out of the box; the bundled default is Decius CSS.

Status: alpha. Broad standards coverage, real UIs run today, but expect bugs and expect APIs to move.

Note: this release carries no -alpha suffix in its version number, but AffineUI is alpha and pre-1.0. Features, APIs, and the set of supported platforms are all still in flux.

Verified on: Linux (Ubuntu, x86-64), macOS (Apple Silicon), and Windows (x86-64) — the full suite (600+ tests) passes on each. Other platforms and architectures are not yet supported.


Install

pip install affineui

Prebuilt wheels ship for CPython 3.9 – 3.13 on Linux (manylinux_2_28 x86_64), macOS (universal2 — Intel + Apple Silicon), and Windows AMD64.

For a source install from a clone of the main repo:

pip install ./bindings/python           # regular install
pip install -e ./bindings/python        # editable / dev

Hello, world

import affineui as ui

view = ui.View(ui.ViewTheme.Decius)
view.begin()
view.heading(1, "Hello from Python")
view.paragraph("AffineUI — native HTML/CSS, no browser, no JS.")
view.button("Click me", primary=True, key="go").on_click(lambda: print("clicked!"))
view.end()

app = ui.App(title="Hello", width=720, height=480)
app.load_view(view)
raise SystemExit(app.run())

Raw HTML

import affineui as ui

app = ui.App(title="Hello", width=720, height=480)
app.load_html("""
  <main style="padding: 24px; font-family: sans-serif;">
    <h1>Hello from Python</h1>
    <p>AffineUI is alive.</p>
    <button>Click me</button>
  </main>
""")
raise SystemExit(app.run())

Headless (no window — for CI and tests)

import affineui as ui

doc = ui.document(
    "<main><h1>Hello</h1><p>Layout without a window.</p></main>",
    "main { padding: 16px; } h1 { font-size: 32px; }",
    width=640, height=360,
)
print(ui.version(), doc.content_size())

A modest app

A live-updating counter — state lives in Python; the reconciler diffs your view and patches the DOM in place. CSS hover/focus/animation keeps running between updates.

import affineui as ui

count = 0
app = ui.App(title="Counter", width=480, height=240)

def build_view() -> ui.View:
    view = ui.View(ui.ViewTheme.Decius)
    view.begin()
    view.heading(1, f"Count: {count}")
    view.button("Increment", primary=True, key="inc").on_click(bump)
    view.button("Reset",                    key="reset").on_click(reset)
    view.end()
    return view

def bump():
    global count
    count += 1
    app.load_view(build_view())

def reset():
    global count
    count = 0
    app.load_view(build_view())

app.load_view(build_view())
raise SystemExit(app.run())

The main repo's bindings/python/examples/ ships larger runnable programs — a component gallery, a photo editor, and a full Bootstrap-styled panel demo.


Loading design-system CSS

Decius CSS is the default when you use the component API. To render your own HTML with a framework stylesheet, tell the app where its asset folder is:

app = ui.App(
    title="Bootstrap demo",
    width=1280,
    height=720,
    asset_folders=["examples"],          # so href="frameworks/..." resolves
)
app.load_html("""
  <link rel="stylesheet" href="frameworks/css/bootstrap-5.3.8.min.css">
  <div class="container py-4">
    <button class="btn btn-primary">Native Bootstrap</button>
  </div>
""")
raise SystemExit(app.run())

Bootstrap 4.6 / 5.3, Tailwind-style utility classes, and Ant-style component markup all render — this is a real CSS engine, not an HTML-shaped layout solver.


What AffineUI is not

  • Not a browser. No navigation, no fetch, no cookies.
  • Not a nerfed HTML5. Missing non-esoteric features are bugs.
  • Not a security sandbox. Never feed it untrusted HTML/CSS/JS.
  • Not an everything-included framework. No video decode, no audio, no 3D — those are your app's job.
  • Not (yet) a JS runtime. JS + React support is on the roadmap as an opt-in extension.

See the main README for the full picture, embedding notes, C++ / Rust / C# APIs, and the demo gallery.


Metadata

Release files for affineui 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for affineui 0.4.2
File Size Uploaded
affineui-0.4.2.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for affineui 0.4.2
File
affineui-0.4.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
affineui-0.4.2-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
affineui-0.4.2-cp313-cp313-macosx_11_0_universal2.whl CPython 3.13 CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64) Details
affineui-0.4.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
affineui-0.4.2-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
affineui-0.4.2-cp312-cp312-macosx_11_0_universal2.whl CPython 3.12 CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64) Details
affineui-0.4.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
affineui-0.4.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
affineui-0.4.2-cp311-cp311-macosx_11_0_universal2.whl CPython 3.11 CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64) Details
affineui-0.4.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
affineui-0.4.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
affineui-0.4.2-cp310-cp310-macosx_11_0_universal2.whl CPython 3.10 CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64) Details
affineui-0.4.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
affineui-0.4.2-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details
affineui-0.4.2-cp39-cp39-macosx_11_0_universal2.whl CPython 3.9 CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64) Details

Total release size: 37.0 MB

Release files / affineui-0.4.2.tar.gz

Download URL affineui-0.4.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c9e113b07243fed95769d0e8417b10779dbab1cd5ea3a65ab0322ea3a12d6eb0
BLAKE2b-256 checksum
How to use checksums
070a776694c29fa3934bb42419273fba5a587d444a7eebb10351d156616aa49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp313-cp313-win_amd64.whl

Download URL affineui-0.4.2-cp313-cp313-win_amd64.whl
Size 1.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
9faddefbe86264f491e1fc131a9da2e72a39b0a7ef988d257dfe9c1614e191d7
BLAKE2b-256 checksum
How to use checksums
88bc11c38d7a529711312bb7402b7188604da9de032906d7a9877d0ba53a8d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL affineui-0.4.2-cp313-cp313-manylinux_2_28_x86_64.whl
Size 2.1 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cd44f1c7488f45d622d149193d6820b0b1ebd585f45e060f5b32713aa44bb576
BLAKE2b-256 checksum
How to use checksums
74e3312d21dd4c82a84ca001b867ca9e1c3b4044ef0c534bc7ca1721b34d89fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp313-cp313-macosx_11_0_universal2.whl

Download URL affineui-0.4.2-cp313-cp313-macosx_11_0_universal2.whl
Size 3.4 MB
Tags CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
9783542af36ccb59cea00f37877755f588cd74088f598803705c1181ff8ae6c5
BLAKE2b-256 checksum
How to use checksums
49d1e371daee97a3757fec5ab5abb4fc54013e59a11f830f5ce9ea698c9c817c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp312-cp312-win_amd64.whl

Download URL affineui-0.4.2-cp312-cp312-win_amd64.whl
Size 1.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5cdbbca6cead0b444985d73dad4e9b2067f65ce8291281651b283a8124276cea
BLAKE2b-256 checksum
How to use checksums
fc19d9c065e7b54e378413bb56b0e6eecae808e139a4d5a0e6b3dd5fdeea38e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL affineui-0.4.2-cp312-cp312-manylinux_2_28_x86_64.whl
Size 2.1 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c5917ea7e48e0042e58fa3dd2d5531a5cedcda765d0a74e101f3c434eb4d40d
BLAKE2b-256 checksum
How to use checksums
04670d074f76ebf2c6420ba51a090a65b743347492ed494773693408dcda06e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp312-cp312-macosx_11_0_universal2.whl

Download URL affineui-0.4.2-cp312-cp312-macosx_11_0_universal2.whl
Size 3.4 MB
Tags CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
d486aaef6436c90ccfe3be4a7d50e97435b33458b74a6e7de7685711079d011e
BLAKE2b-256 checksum
How to use checksums
58211c5b1b4418730457b0bfe1480608e5324acaacee5ff768073f04375bf80b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp311-cp311-win_amd64.whl

Download URL affineui-0.4.2-cp311-cp311-win_amd64.whl
Size 1.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
597e2e0d749cf7394772ba83a3ce3a27f60cb8b581ce025053d91b321d8ef0da
BLAKE2b-256 checksum
How to use checksums
d097b08d7c50209e4d5355843650186828e2f63ffc219bca2188b6c50e308f14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL affineui-0.4.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 2.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5a8ece082140a8d03a39dca353c9db46675746e28cc88aeffae541e274728e99
BLAKE2b-256 checksum
How to use checksums
75abc6d839953e097bf40fc5992c32673dc2a35e2aaeabdfd18d91fa291f7a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp311-cp311-macosx_11_0_universal2.whl

Download URL affineui-0.4.2-cp311-cp311-macosx_11_0_universal2.whl
Size 3.4 MB
Tags CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
b3ea36677fa36d653e6ce9f915cfcc24e7882cf73acaa1733cf666bc58e4ada7
BLAKE2b-256 checksum
How to use checksums
ac53a27a95fb10fd843299dde3a0fa78e807925ff965b3887bd305ea2d2d200e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp310-cp310-win_amd64.whl

Download URL affineui-0.4.2-cp310-cp310-win_amd64.whl
Size 1.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
357154a5b4080f1d176712a9ef8793d980ce9212334ff19cf600c35e0ed56c24
BLAKE2b-256 checksum
How to use checksums
388fcf412adf2846776a1c0762b971f6da709b7fcfb99709a39258a310999359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL affineui-0.4.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c4fbcc969e20eaf0b3fcab45ec337b3adc5b2a13e0b19d408136cf7e443dc64c
BLAKE2b-256 checksum
How to use checksums
5ef70e9e8f7e982e9903803e7f0563cb1aff11971b477a8eb3e551165996a859
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp310-cp310-macosx_11_0_universal2.whl

Download URL affineui-0.4.2-cp310-cp310-macosx_11_0_universal2.whl
Size 3.4 MB
Tags CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
03cc5135270597e99e390bb144dc6a542cf340ffa285ad780e6724fcef4d9641
BLAKE2b-256 checksum
How to use checksums
d7420b9d78182ebb2ca9276890cbb6fa10e5a558891142bcce36342b24583be0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp39-cp39-win_amd64.whl

Download URL affineui-0.4.2-cp39-cp39-win_amd64.whl
Size 1.6 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0a98891d627263864db4b561803eeecc724f297746429f7c867ae69d719fe73e
BLAKE2b-256 checksum
How to use checksums
82e222b174f197874fa8f4fd56cbe758c092d2d0e78812d10d837183d8bfe2bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL affineui-0.4.2-cp39-cp39-manylinux_2_28_x86_64.whl
Size 2.1 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
00c7f01223cfc9653ecd7bfc6b9bea8be4c96fb221b46f3883c0d34d33c6e0cd
BLAKE2b-256 checksum
How to use checksums
76dc1a882a9d2b6cdece9ffca80cc88af5c2e6b12c79632288531fda8d361900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / affineui-0.4.2-cp39-cp39-macosx_11_0_universal2.whl

Download URL affineui-0.4.2-cp39-cp39-macosx_11_0_universal2.whl
Size 3.4 MB
Tags CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
916df7ab6c0aefefe8335f7f65c7f57393aa58f2f3667214db11f982a7ae4a9b
BLAKE2b-256 checksum
How to use checksums
53b9e2902a8eb9f583370c309d7167a23f36fad158fcbc74ec5085cfb79853a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.2 This release

16 release files

0.4.1

16 release files

0.4.0

16 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page