DEV Community

Cover image for I Just Shipped a Major Update to My Python GUI Library (PyUIkit)
programmingGreen
programmingGreen

Posted on

I Just Shipped a Major Update to My Python GUI Library (PyUIkit)

๐Ÿš€ I Just Shipped a Major Update to My Python GUI Library (PyUIkit)

Building desktop GUIs in Python has always felt either too low-level or too restrictive.
Thatโ€™s why Iโ€™ve been building PyUIkit โ€” a modern, component-based GUI library inspired by web layouts.

Today, I shipped a big update, and I wanted to share what changed and why.


What is PyUIkit?

PyUIkit is a Python GUI framework built on top of customtkinter, but with a web-like mental model:

  • Components (Button, Switch, Toast, etc.)
  • Layout containers (Div)
  • Auto-stacking (no need to always specify x / y)
  • Simple, readable APIs

If you wanna see more about the library see the full release post or the Github repo


โœจ Whatโ€™s New in This Update

Toast Notifications (NEW)

I added a Toast component with:

  • Slide-in & slide-out animations
  • Auto-dismiss after duration
  • Manual close button
  • Multiple positions (top-right, bottom-left, etc.)
  • Custom colors, sizes, and text
Toast(
    text="Build succeeded!",
    bg_color="#4caf50",
    duration=3
).show()
Enter fullscreen mode Exit fullscreen mode

No modal. No blocking. Just feedback โ€” like the web.


Switch Component (NEW)

This update introduces a Switch component for toggle-based interactions โ€” ideal for settings, preferences, and feature flags.

Key features:

  • Clear ON / OFF state handling
  • Optional default state
  • Fully compatible with auto-stacking layouts
  • Global access via a unique id
Switch(
    id="darkMode",
    text="Enable Dark Mode",
    default=True
)
Enter fullscreen mode Exit fullscreen mode

You can access the switch state from anywhere in your app:

state = Switch.get_state(id="darkMode")  # 1 = ON, 0 = OFF
Enter fullscreen mode Exit fullscreen mode

This makes it easy to connect UI toggles to application logic without passing references around.


Consistent Component API

Across components, the API is now more consistent:

  • text, color, text_color, bg_color
  • Optional id for dynamic access
  • Auto layout of components inside a div unless positioning is explicitly provided

This makes building complex UIs feel predictable.


Stress Tested with Complex Layouts

I tested this update using deeply nested layouts, mixed auto/manual positioning, and multiple interactive components (buttons, switches, toasts firing from callbacks).


Whatโ€™s Next?

Some ideas Iโ€™m actively thinking about:

  • Responsive behavior (desktop-style responsiveness, not CSS)
  • Better animations
  • More components

๐Ÿ”— Links

If youโ€™re interested in desktop UI but prefer web-like ergonomics, Iโ€™d love feedback โ€” good or bad.


If you made it this far, thanks for reading ๐Ÿ™Œ

Still early, still evolving โ€” but this update feels like meaningful progress.

I would love to hear what you think!

Top comments (0)