I Just Shipped a Major Update to My Python GUI Library (PyUIkit)
Source: Dev.to
Overview
Building desktop GUIs in Python has often felt either too low‑level or too restrictive.
PyUIkit is a modern, component‑based GUI library inspired by web layouts, built on top of customtkinter. It offers:
- Components (Button, Switch, Toast, etc.)
- Layout containers (
Div) - Auto‑stacking (no need to always specify
x/y) - Simple, readable APIs
The latest release adds significant new features and refines the API.
New Toast Component
A lightweight, non‑modal feedback element with the following capabilities:
- Slide‑in & slide‑out animations
- Auto‑dismiss after a configurable 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 behavior, no blocking—just instant feedback, similar to web notifications.
New Switch Component
A toggle‑based component 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
)
Retrieve the switch state from anywhere in the app:
state = Switch.get_state(id="darkMode") # 1 = ON, 0 = OFF
API Consistency
Across all components the API now follows a more uniform pattern:
- Common properties:
text,color,text_color,bg_color - Optional
idfor dynamic access - Automatic layout inside a
Divunless explicit positioning is provided
This consistency makes building complex UIs more predictable.
Testing & Future Ideas
The update has been tested with:
- Deeply nested layouts
- Mixed auto/manual positioning
- Multiple interactive components (buttons, switches, toasts triggered from callbacks)
Planned enhancements include:
- Responsive behavior (desktop‑style responsiveness, not CSS)
- Improved animations
- Additional components
Installation & Documentation
- PyPI:
- Docs / Quickstart:
Conclusion
If you’re interested in desktop UI but prefer web‑like ergonomics, I’d love your feedback—good or bad. The library is still early and evolving, but this update represents meaningful progress. Feel free to share your thoughts!