Skip to main content

XUT — Simple. Powerful. Instant UI.

XUT is a modern UI toolkit designed to feel effortless for beginners while staying insanely powerful for advanced users. It combines the simplicity of immediate-mode APIs with the performance and flexibility of retained-mode systems under the hood.


✨ Philosophy

  • Beginner-friendly, zero friction
  • Powerful and scalable
  • Immediate-mode on the surface
  • Retained-mode internally

🚀 Getting Started

Installation

pip install xut

Basic Setup

import xut

app = xut.App(theme="applesauce-mono")

🎨 Themes

Resolution Order

XUT automatically resolves themes in this order:

  1. ./applesauce-mono.xut
  2. ./applesauce-mono/applesauce-mono.xut
  3. Installed themes
  4. Default fallback

Theme Structure

applesauce-mono/
  applesauce-mono.xut
  fonts/
    Inter.ttf

Features

  • Hex colors
  • Variables
  • Global values
  • Font loading
  • Brightness modifiers
  • Hot-reload support 🔥

🔁 Main Loop

while app.running:
    app.begin_frame()
    # UI here
    app.end_frame()

Stop the app anytime:

app.stop()

🧠 Core Concepts

All UI elements share a unified API:

  • id (unique identifier)
  • pos=(x, y)
  • size=(w, h) (if applicable)
  • z (layer depth)
  • rotation (degrees)
  • font_size

Most elements return a handle, allowing real-time updates — even after creation.


🧩 UI Elements

🖼 Image

img = app.image("logo", path="assets/logo.png", pos=(100, 100), size=(128, 128))
img.rotation = 45

🔘 Button

if app.button_clicked("btn", "Click Me", pos=(100, 100), size=(120, 40)):
    print("clicked")

🧷 Icon Button

app.icon_button_clicked("save", "icons/save.png", pos=(50, 50), size=(40, 40))

Layouts:

  • icon_only
  • text_right
  • text_below

🏷 Label

app.label("Hello", pos=(100, 100))

Mutable label:

lbl = app.label_ex("status", "Ready", pos=(100, 100))
lbl.text = "Done!"

🧾 Input

text = app.input("username", pos=(100, 200), size=(300, 40))

🎚 Slider

value = app.slider("volume", pos=(100, 300), size=(300, 16))

☑ Checkbox / Toggle

app.checkbox("enable", "Enable", pos=(100, 350))
app.toggle("power", pos=(100, 400))

📊 Progress

app.progress(0.7, pos=(100, 500), size=(300, 10))

📂 Dropdown

app.dropdown("role", ["User", "Admin"], pos=(100, 550), size=(300, 40))

🧱 Layout Components

  • panel()
  • window()
  • tabs()
  • scrollbar()
  • divider()

⚙️ Element Handles (🔥 Powerful)

Every element can be modified live:

btn = app.button_clicked("ok", "OK", pos=(100, 100), size=(80, 32))

handle = app.get("ok")
handle.pos = (200, 300)
handle.text = "Confirm"
handle.rotation = 15

Properties

Property Description
pos Position
size Size
z Layer
text Label text
value Numeric value
rotation Rotation
font_size Font override
clicked Clicked this frame
hovered Mouse over
pressed Mouse held

🧠 Internal Behavior

Persistence

  • Elements are cached by id
  • Automatically reused every frame

Rendering

  • Sorted by z
  • Proper hitboxes (even rotated)

Events

  • Top layer gets priority
  • Stops propagation on interaction

🎨 Theme Control

Change Theme

app.set_theme("dark-pro")

Hot Reload

app.reload_theme()

Perfect for live editing your .xut files.


🪟 Window Control

app.set_window_title("My App")
app.set_window_icon("assets/icon.png")

⌨️ Shortcuts

if app.shortcut("ctrl+s"):
    save()

Supports:

  • ctrl, shift, alt, cmd
  • Letters, numbers
  • Function keys
  • Arrow keys

⚡ Example

import xut

app = xut.App("applesauce-mono", title="Settings")

while app.running:
    app.begin_frame()

    active = app.tabs("tabs", ["General", "Audio"], pos=(100, 100), size=(300, 30))

    if app.button_clicked("save", "Save", pos=(100, 200), size=(120, 40)):
        app.set_window_title("Saved!")

    if app.shortcut("ctrl+s"):
        print("Saved via shortcut")

    app.end_frame()

💡 Why XUT?

  • No boilerplate
  • No layout headaches
  • Real-time mutation
  • Hot-reload themes
  • Works great for tools, apps, and even full desktop environments 👀

🧪 Status

XUT is actively evolving. Expect rapid improvements, new elements, and deeper customization.


🧡 Contributing

Ideas, feedback, and contributions are welcome.

Find it on PyPi: https://pypi.org/project/xut/0.1.0/


📄 License

MIT


Build fast. Iterate faster. Ship instantly.

Metadata

Release files for xut-win 0.1.1

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

Source distribution (sdist)

Source distribution for xut-win 0.1.1
File Size Uploaded Provenance Actions
xut_win-0.1.1.tar.gz 26.0 MB Without provenance Details for xut_win-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xut-win 0.1.1
File Interpreter ABI Platform Actions
xut_win-0.1.1-py3-none-any.whl Python 3 none any Details for xut_win-0.1.1-py3-none-any.whl

Total release size: 52.9 MB

Release files / xut_win-0.1.1.tar.gz

Download URL xut_win-0.1.1.tar.gz
Size 26.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a18ddd4c2bab1a670435c13f8569411298d389e45cdf9b7b57425f4077a6e3a5
BLAKE2b-256 checksum
How to use checksums
c07a1c9a82263e6ee68e75ef06b67712cdac14fc02da3f144af6d84dc5244ab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / xut_win-0.1.1-py3-none-any.whl

Download URL xut_win-0.1.1-py3-none-any.whl
Size 26.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e3a7cbfc36a54d792d4a991229e1a6e490c22e3ec65bb5f9d170a83b4a140558
BLAKE2b-256 checksum
How to use checksums
3da411a67ae81d00708af7c8d65cf09bd9d3aea5f7451c8f3419cdb05e951fee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for xut-win 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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