๐ 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()
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
)
You can access the switch state from anywhere in your app:
state = Switch.get_state(id="darkMode") # 1 = ON, 0 = OFF
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
idfor 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
- Pypi: https://pypi.org/project/pyuikit/
- Docs / Quickstart: https://github.com/Huzaifa-Atiq/PyUIkit/blob/main/documentation/Quickstart.md
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)