CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyqt-fluent-widgets

A fluent design widgets library based on PyQt5 providing modern Windows 11-style UI components

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

display-widgets.mddocs/

Display Widgets

Labels, images, cards, and container widgets for displaying content with fluent design typography and layout patterns. These widgets provide modern visual styling with proper theme integration and typography hierarchy.

Capabilities

Card Widgets

Container widgets with fluent design styling for grouping related content with material design elevation and rounded corners.

class CardWidget(QWidget):
    def __init__(self, parent=None): ...
    def setBorderRadius(self, radius: int): ...
    def borderRadius(self) -> int: ...

class SimpleCardWidget(CardWidget):
    def __init__(self, parent=None): ...

class ElevatedCardWidget(CardWidget):
    def __init__(self, parent=None): ...

class HeaderCardWidget(CardWidget):
    def __init__(self, parent=None): ...
    def setTitle(self, title: str): ...
    def title(self) -> str: ...

Usage Example:

from qfluentwidgets import CardWidget, ElevatedCardWidget, HeaderCardWidget

# Basic card container
card = CardWidget(self)
card.setFixedSize(300, 200)

# Elevated card with shadow
elevated_card = ElevatedCardWidget(self)
elevated_card.setFixedSize(280, 180)

# Card with header
header_card = HeaderCardWidget(self)
header_card.setTitle("Settings")
header_card.setFixedSize(320, 240)

Typography Labels

Hierarchical text labels following fluent design typography system with automatic theme support.

class BodyLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

class CaptionLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

class StrongBodyLabel(QLabel):
    def __init__(self, parent=None): ...  
    def __init__(self, text: str, parent=None): ...

class SubtitleLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

class TitleLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

class LargeTitleLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

class DisplayLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...

Usage Example:

from qfluentwidgets import (BodyLabel, TitleLabel, SubtitleLabel, 
                           LargeTitleLabel, DisplayLabel, CaptionLabel)

# Typography hierarchy
display_title = DisplayLabel("Main Title", self)
large_title = LargeTitleLabel("Section Title", self)
title = TitleLabel("Subsection", self)
subtitle = SubtitleLabel("Description", self)
body = BodyLabel("Regular content text here...", self)
caption = CaptionLabel("Small caption text", self)

# Auto-themed typography
for label in [display_title, large_title, title, subtitle, body, caption]:
    label.setWordWrap(True)

Image and Icon Display

Specialized widgets for displaying images, icons, and avatars with fluent design integration.

class ImageLabel(QLabel):
    def __init__(self, parent=None): ...
    def setImage(self, image: Union[str, QPixmap, QIcon]): ...
    def setBorderRadius(self, radius: int, corners: Qt.Corners = Qt.Corners()): ...

class PixmapLabel(QLabel):
    def __init__(self, parent=None): ...
    def setPixmap(self, pixmap: QPixmap): ...
    def setBorderRadius(self, radius: int, corners: Qt.Corners = Qt.Corners()): ...

class AvatarWidget(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, image: Union[str, QPixmap, QIcon], parent=None): ...
    def setImage(self, image: Union[str, QPixmap, QIcon]): ...
    def setRadius(self, radius: int): ...

class IconWidget(QWidget):
    def __init__(self, icon: Union[FluentIconBase, QIcon, str] = None, parent=None): ...
    def setIcon(self, icon: Union[FluentIconBase, QIcon, str]): ...
    def icon(self) -> QIcon: ...

Usage Example:

from qfluentwidgets import ImageLabel, AvatarWidget, IconWidget, FluentIcon as FIF

# Image display with rounded corners
image_label = ImageLabel(self)
image_label.setImage("path/to/image.png")
image_label.setBorderRadius(8)
image_label.setFixedSize(200, 150)

# Circular avatar
avatar = AvatarWidget("user_photo.jpg", self)
avatar.setRadius(30)
avatar.setFixedSize(60, 60)

# Icon display
icon_widget = IconWidget(FIF.HOME, self)
icon_widget.setFixedSize(24, 24)

Hyperlink Labels

Clickable text labels for navigation and external links with fluent styling.

class HyperlinkLabel(QLabel):
    def __init__(self, parent=None): ...
    def __init__(self, text: str, parent=None): ...
    def __init__(self, url: str, text: str, parent=None): ...
    def setUrl(self, url: str): ...
    def getUrl(self) -> str: ...
    
    # Signals
    linkActivated = pyqtSignal(str)

Usage Example:

from qfluentwidgets import HyperlinkLabel

# Basic hyperlink
link = HyperlinkLabel("Visit our website", self)
link.setUrl("https://example.com")
link.linkActivated.connect(self.open_link)

# Link with custom text
docs_link = HyperlinkLabel("https://docs.example.com", "Documentation", self)

# Connect to custom handler
def open_link(self, url):
    print(f"Opening: {url}")
    # Custom link handling logic

Progress Indicators

Visual progress indicators with fluent design styling for showing task completion and loading states.

class ProgressBar(QProgressBar):
    def __init__(self, parent=None): ...
    def setRange(self, min: int, max: int): ...
    def setValue(self, value: int): ...

class IndeterminateProgressBar(ProgressBar):
    def __init__(self, parent=None): ...
    def start(self): ...
    def stop(self): ...
    def pause(self): ...
    def resume(self): ...

class ProgressRing(QWidget):
    def __init__(self, parent=None): ...
    def setRange(self, min: int, max: int): ...
    def setValue(self, value: int): ...
    def setStrokeWidth(self, width: int): ...

class IndeterminateProgressRing(ProgressRing):
    def __init__(self, parent=None): ...
    def start(self): ...
    def stop(self): ...

Usage Example:

from qfluentwidgets import ProgressBar, IndeterminateProgressBar, ProgressRing

# Standard progress bar
progress = ProgressBar(self)
progress.setRange(0, 100)
progress.setValue(45)

# Loading indicator
loading = IndeterminateProgressBar(self)
loading.start()

# Circular progress
ring = ProgressRing(self)
ring.setRange(0, 100)
ring.setValue(75)
ring.setStrokeWidth(4)

Common Display Widget Properties

All display widgets inherit standard Qt functionality with fluent design enhancements:

# Standard text properties
label.setText("New text")
label.setAlignment(Qt.AlignCenter)
label.setWordWrap(True)

# Theming support
label.setObjectName("customLabel")
label.setStyleSheet("color: red;")

# Size and visibility
widget.setFixedSize(200, 100)
widget.setVisible(True)
widget.setEnabled(True)

Styling and Themes

Display widgets automatically adapt to theme changes and can be customized:

from qfluentwidgets import isDarkTheme, FluentStyleSheet

# Apply fluent styling
FluentStyleSheet.LABEL.apply(label)

# Theme-aware styling
if isDarkTheme():
    label.setStyleSheet("color: white; background: #2b2b2b;")
else:
    label.setStyleSheet("color: black; background: white;")

Install with Tessl CLI

npx tessl i tessl/pypi-pyqt-fluent-widgets

docs

buttons.md

dialog-notification.md

display-widgets.md

index.md

input-controls.md

layout-animation.md

list-view-widgets.md

material-effects.md

menu-command.md

multimedia.md

settings-config.md

theme-styling.md

window-navigation.md

tile.json