Skip to main content

Neony

Reactive desktop UI framework for Python, built on LumiView.

License: LGPL-3.0 Python Status: alpha

中文文档 · API Reference (EN) · API 参考 (中文) · Contributing


Overview

Status: alpha — the API is still settling. Feedback and contributions are welcome.

Neony renders a reactive DOM in a native window. You compose your UI from Python objects — components, layouts, styles — and Neony diff-updates the browser DOM automatically. No HTML, no JavaScript.

It builds on LumiView, which uses the same Rust tao/wry webview stack as Tauri.

  • Pure Python API — components, layouts and events, no need for non-python codes
  • Fine-grained reactivitySignal / Computed / Effect primitives with declarative bindings
  • Dirty-subtree diffing — only changed elements re-serialize; unchanged subtrees reuse cached snapshots
  • Style direct-patch — pure style/attr changes (hover, focus, press) patch straight from the snapshot cache, skipping serialization and diff
  • Same stack as Tauri — Rust tao/wry webviews via LumiView
  • 3 theme presets — dark / light / deep-blue via CSS custom properties
  • (Optional) Frosted glass — translucent surfaces with backdrop blur
  • Colour-matched glow — focus rings and hover glows tinted with each element's semantic colour
  • Theme-matched scrollbars — scrollbars follow the active theme (WebKit + Firefox)
  • Custom window chrome — frameless, transparent, custom TitleBar
  • (Supported platform only) Native window effects — blur / acrylic / mica materials

Installation

pip install neony

Requires Python 3.11+ and the platform WebView stack (WebKitGTK on Linux, WebView2 on Windows, WKWebView on macOS). X11 is not supported — see the Roadmap.


Quick Start

from neony.application import Page, launch
from neony.application.elements import Button, Heading, Text, VStack

counter = Button("Click me")


async def on_click(event) -> None:
    counter.label = "Clicked!"


counter.on_click(on_click)

page = Page(gap="16px").add(
    VStack(
        Heading("Hello, Neony", level=1),
        Text("Build desktop UI in pure Python.", role="secondary"),
        counter,
        gap="12px",
    )
)

launch(page, title="My App", width=480, height=360, devtools=True)

Components

Import from neony.application.elements.

Component Description
Button Themed push button — primary / ghost / danger variants, hover & press feedback
Checkbox Custom-styled checkbox with label and change event
Input Single-line text field — text / password / email / number…
Heading Themed heading (h1–h6) with automatic sizing
Text Inline body copy with semantic roles (primary / secondary / danger / success)
Tabs Tab bar + panels, exactly one visible at a time
Flex Generic flex container with full control
VStack / HStack Vertical / horizontal flex stacks
Spacer Flexible empty space that absorbs leftover room
Separator Subtle horizontal divider
GlassPanel Frosted-glass container with optional background image
TitleBar Custom window chrome for frameless windows — drag, minimize / maximize / close
Sidebar / SidebarItem Vertical navigation rail, glass-matched to the TitleBar

All components share a fluent, chainable API — see the API reference for usage.


Window Features

  • Frameless custom titlebar — set decorations=False, add a TitleBar, and drag / minimize / maximize / close all work automatically. See docs/api.en.md and the demo_custom_window.py demo.
  • Transparent windows & native effectstransparent=True plus apply_blur(), apply_acrylic(), apply_mica(). See demo_transparent_panel.py.
  • Programmatic window controlset_title(), set_size(), minimize(), toggle_maximize(), close(), … all on NeonApplication, with window_index=0 for multi-window apps.
  • Multi-windowrun(*pages) opens one window per page, all sharing one event loop and app.state. launch([...]) accepts a list. See demo_multi_window.py.

Theming

Three built-in presets — DARK (default), LIGHT, DEEP_BLUE — exposed as CSS custom properties on :root, so a theme switch redraws the whole UI with zero DOM diff. Scrollbars and interaction glows (focus rings, hover halos) reference the same --color-* tokens, so they follow theme switches too. See the API reference for switching and custom themes.


Demos

Run from the repository root:

File Shows
demo_hello.py Minimal first app (same as the Quick Start example)
demo_gallery.py Component gallery with docs & code samples, glass TitleBar
demo_custom_window.py Frameless window: TitleBar + Sidebar chrome
demo_transparent_panel.py Floating transparent panel with native blur
demo_multi_window.py Two windows sharing one app state
demo_reactive.py Signal-based API: declarative bindings instead of manual refresh
demo_builder.py Raw DOM builder without the app layer
uv run demo_gallery.py

Roadmap

Planned work lives in ROADMAP.md — performance, events, lifecycle, components, animation, platform integration and verification.


Development

This project uses uv as the environment manager and runner.

uv sync --group dev   # install dependencies (incl. dev tools)
npm ci                # install JS dev dependencies (vitest, jsdom)

uv run demo_gallery.py            # run a demo
uv run pytest -q                  # run the Python test suite
uv run ruff check .               # lint
uv run ruff format --check .      # format check
uv run pyrefly check              # type check
npm test                          # run the JS test suite (vitest)

License

LGPL-3.0-or-later © HarcicYang

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neony-0.1.1.tar.gz (100.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neony-0.1.1-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file neony-0.1.1.tar.gz.

File metadata

  • Download URL: neony-0.1.1.tar.gz
  • Upload date:
  • Size: 100.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for neony-0.1.1.tar.gz
Algorithm Hash digest
SHA256 28f6e9f2dae3a5023d3e2a5db81671e970ebf2936a6cd08849ff9639e9aee922
MD5 065f5d5e2b44d22f8b22a5dd057eca5b
BLAKE2b-256 136e460d05e6daa5af4d5d9cfd673673804c3b64e188b5484d22da71623ac172

See more details on using hashes here.

Provenance

The following attestation bundles were made for neony-0.1.1.tar.gz:

Publisher: pypi.yml on HarcicYang/Neony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file neony-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: neony-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 75.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for neony-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5810019fb00b91210d360687aa651c2201bec2d8ee932232d685bae7cd978f07
MD5 7e92f8f933827774b08881fa2f7ebf2a
BLAKE2b-256 56a496897c138e8e22a0f9fb077ea2c264d756fb9d8cbe25af040b185a5fd7f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for neony-0.1.1-py3-none-any.whl:

Publisher: pypi.yml on HarcicYang/Neony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page