Skip to main content

Modern PyQt6 UI components with glassmorphism effects and smooth animations

Project description

Custom UI Components for PyQt6

PyPI version Python 3.8+ License: MIT

Modern, reusable PyQt6 UI components with glassmorphism effects and smooth animations. Perfect for building beautiful, modern desktop applications with solid color theming.

✨ Features

🎨 Modern Design

  • Solid color backgrounds with transparency effects
  • Semi-transparent glassmorphism effects
  • Smooth hover transitions and animations
  • Professional typography and spacing

🎯 User-Friendly

  • Draggable frameless windows
  • Clear visual hierarchy
  • Intuitive interactions
  • Responsive visual feedback

🔄 Reusable & Flexible

  • Easy to integrate into any PyQt6 project
  • Highly customizable colors and styles
  • Modular component architecture
  • Well-documented with examples

🎨 Solid Color Theming

  • Direct color assignment (no complex gradient setup)
  • Runtime color updates
  • Hex (#RRGGBB) and RGBA color support
  • Consistent color palette across components

📦 Installation

Install from PyPI:

pip install custom-ui-pyqt6

Or install from source:

git clone https://github.com/yourusername/custom-ui-pyqt6.git
cd custom-ui-pyqt6
pip install -e .

🚀 Quick Start

Basic Application

import sys
from PyQt6.QtWidgets import QApplication
from custom_ui_package import CustomMainWindow, CustomTitleBar, CustomLabel, CustomButton

class MyApp(CustomMainWindow):
    def __init__(self):
        super().__init__(
            title='My Application',
            width=600,
            height=500,
            bg_color='#1a0f2e'  # Solid color background
        )

        # Add custom title bar
        title_bar = CustomTitleBar(
            parent=self,
            title='My Application',
            bg_color='#7a00ff',
            text_color='#e8f0ff',
            font_size=16,
            bold=True
        )
        self.centralWidget().layout().insertWidget(0, title_bar)

        # Add content
        welcome_label = CustomLabel(
            parent=self.overlay_widget,
            text='Welcome to My App!',
            size=(300, 40),
            position=(40, 30),
            font_size=20,
            bold=True,
            color='#a855f7'
        )

        button = CustomButton(
            parent=self.content_widget,
            title='Get Started',
            size=(150, 45),
            font_size=12
        )
        button.clicked.connect(self.get_started)
        self.add_content(button)

        self.add_stretch()

    def get_started(self):
        print("Getting started!")

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = MyApp()
    window.show()
    sys.exit(app.exec())

🎛️ Components

CustomMainWindow

Frameless main window with solid color backgrounds and customizable styling.

from custom_ui_package import CustomMainWindow

window = CustomMainWindow(
    title='My App',
    width=800,
    height=600,
    bg_color='#1a0f2e'  # Solid background color
)

# Runtime color updates
window.set_custom_colors({
    'button_color': '#ec4899',
    'text_primary': '#f3e8ff'
})

CustomTitleBar

Custom title bar for frameless windows with configurable fonts and colors.

from custom_ui_package import CustomTitleBar

title_bar = CustomTitleBar(
    parent=window,
    title="My Application",
    bg_color='#7a00ff',
    text_color='#e8f0ff',
    font_size=16,        # Custom font size
    bold=True,           # Bold text
    show_minimize=True,
    show_close=True
)

CustomLabel

Configurable label with support for both layout-managed and absolute positioning.

from custom_ui_package import CustomLabel

# Content area label (layout-managed)
content_label = CustomLabel(
    parent=self.content_widget,
    text="Hello World",
    size=(150, 30),
    font_size=12,
    bold=True
)
self.add_content(content_label)

# Overlay label (absolute positioning)
overlay_label = CustomLabel(
    parent=self.overlay_widget,
    text="Section Title",
    size=(200, 40),
    position=(40, 20),
    font_size=16,
    color='#a855f7'
)

CustomButton

Modern button component with hover effects and custom styling.

from custom_ui_package import CustomButton

button = CustomButton(
    parent=self.content_widget,
    title="Click Me",
    size=(150, 45),
    font_size=12,
    color='#ec4899'  # Custom button color
)
button.clicked.connect(self.handle_click)
self.add_content(button)

CustomDropdown

Modern dropdown with glassmorphism effects and smooth animations.

from custom_ui_package import CustomDropdown

dropdown = CustomDropdown()
dropdown.add_items_with_icons({
    'Python': 'python',
    'JavaScript': 'javascript',
    'Go': 'go'
})

# Customize colors
dropdown.set_custom_colors(
    bg_color='rgba(20, 25, 50, 0.8)',
    text_color='#e0e7ff',
    hover_color='#a78bfa'
)

selected_text = dropdown.get_selected_text()

CustomMessageDialog

Modern message dialog with draggable interface and multiple dialog types.

from custom_ui_package import CustomMessageDialog

# Different dialog types
info_dialog = CustomMessageDialog(
    'Information',
    'This is an info message',
    'info',
    parent_window
)

warning_dialog = CustomMessageDialog(
    'Warning',
    'This is a warning',
    'warning',
    parent_window
)

error_dialog = CustomMessageDialog(
    'Error',
    'This is an error',
    'error',
    parent_window
)

info_dialog.exec()

CustomMenu

Context/application menu with glassmorphism effects, icons, and submenus.

from custom_ui_package import CustomMenu

menu = CustomMenu(title='File')
menu.add_item('New', callback=lambda: print('New'))
menu.add_item('Open', callback=lambda: print('Open'))
menu.add_separator()
menu.add_item('Exit', callback=lambda: print('Exit'))

# With icons and shortcuts
menu.add_item('Copy', icon_path='copy.png', shortcut='Ctrl+C')
menu.add_item('Paste', icon_path='paste.png', shortcut='Ctrl+V')

# Submenu
submenu = menu.add_submenu('Recent Files')
submenu.add_item('File 1.txt')
submenu.add_item('File 2.txt')

# Checkable items
menu.add_item('Show Grid', checkable=True, checked=True)

CustomScrollBar

Modern scrollbar with glassmorphism effects and smooth animations.

from custom_ui_package import CustomMainWindow, CustomVerticalScrollBar

class MyScrollableApp(CustomMainWindow):
    def __init__(self):
        super().__init__(
            title='Scrollable App',
            width=600,
            height=750,
            bg_color='#1a0f2e',
            use_custom_scrollbar=True,
            scrollbar_color='#a855f7',
            scrollbar_width=10
        )

# Or create manually
from custom_ui_package import CustomVerticalScrollBar

scrollbar = CustomVerticalScrollBar(
    handle_color='#a855f7',
    handle_width=10,
    border_radius=8,
    opacity=0.8
)

🎨 Color Theming

Solid Color System

The library now uses a simple solid color system instead of complex gradients:

# Define colors directly
PRIMARY_COLOR = '#a855f7'
BACKGROUND_COLOR = '#1a0f2e'
TEXT_COLOR = '#f3e8ff'

# Use in components
window = CustomMainWindow(bg_color=BACKGROUND_COLOR)

title_bar = CustomTitleBar(
    bg_color=PRIMARY_COLOR,
    text_color=TEXT_COLOR
)

button = CustomButton(color=PRIMARY_COLOR)

Color Formats Supported

  • Hex: #RRGGBB (e.g., #a855f7)
  • RGBA: rgba(r, g, b, a) (e.g., rgba(168, 85, 247, 0.8))

Runtime Color Updates

# Update window colors
window.set_custom_colors({
    'button_color': '#ec4899',
    'text_primary': '#f3e8ff'
})

# Update component colors
dropdown.set_custom_colors(
    bg_color='rgba(20, 25, 50, 0.8)',
    text_color='#e0e7ff'
)

# Update scrollbar colors
scrollbar.update_colors(
    handle_color='#a855f7',
    background_color='#2d1b4e'
)

📋 Components Overview

Component Purpose Key Features
CustomMainWindow Main application window Frameless, solid backgrounds, layout management
CustomTitleBar Window title bar Configurable fonts, colors, minimize/close buttons
CustomButton Interactive buttons Hover effects, custom colors, click handling
CustomLabel Text display Layout-managed or absolute positioning
CustomDropdown Selection dropdown Glassmorphism, icons, smooth animations
CustomDropdownCompact Compact dropdown Smaller variant for space-constrained UI
CustomDropdownLarge Large dropdown Larger variant for better accessibility
CustomMessageDialog Message dialogs Draggable, multiple types (info/warning/error)
CustomMenu Context menus Icons, submenus, checkable items, shortcuts
CustomScrollBar Custom scrollbars Glassmorphism, vertical/horizontal variants
CustomVerticalScrollBar Vertical scrollbar Convenience class for vertical scrolling
CustomHorizontalScrollBar Horizontal scrollbar Convenience class for horizontal scrolling

📚 Documentation & Examples

🔧 Requirements

  • Python 3.8+
  • PyQt6 >= 6.0.0

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

If you encounter any issues or have questions, please open an issue on the GitHub repository.


Happy building! 🚀

Project details


Download files

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

Source Distribution

custom_ui_pyqt6-1.0.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

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

custom_ui_pyqt6-1.0.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file custom_ui_pyqt6-1.0.1.tar.gz.

File metadata

  • Download URL: custom_ui_pyqt6-1.0.1.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for custom_ui_pyqt6-1.0.1.tar.gz
Algorithm Hash digest
SHA256 508de156244800c4f7def46a38e5f9a94b3d360bf0035b7172cc4052784bdd86
MD5 3b01d14dfcf4d142893d0c756725a040
BLAKE2b-256 b22b4d0276da09cd351e3fd9893162e33a9cc38153b714cf8c512c1a553109a5

See more details on using hashes here.

File details

Details for the file custom_ui_pyqt6-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for custom_ui_pyqt6-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fee290c046e19f4cfd6bf81382e66fa324445cb71ac5d486837e69aa8b28da8
MD5 e619267d654423ddb8ff95ac3ed6cbc2
BLAKE2b-256 566a224ee58b58d8fce710864f9f216713ded5b8d8eaeafdfe62fb53263e9ef7

See more details on using hashes here.

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