Skip to content

Container

morphui.uix.container

Reusable container widgets for MorphUI.

This module provides base container classes that implement common layout patterns used across multiple components.

MorphIconLabelContainer(**kwargs)

Bases: MorphLeadingWidgetBehavior, MorphLabelWidgetBehavior, _MorphBaseContainer

Container with leading icon and text label.

This container provides a horizontal layout with two child widgets: a leading icon and a text label. It is designed to be inherited by components that need this layout pattern (e.g., icon buttons, list items with icons).

This class only provides the core layout and widget management. Subclasses should add additional behaviors like: - :class:~morphui.uix.behaviors.MorphColorThemeBehavior - :class:~morphui.uix.behaviors.MorphInteractionLayerBehavior - :class:~morphui.uix.behaviors.MorphSurfaceLayerBehavior

ATTRIBUTE DESCRIPTION
leading_icon

Icon name for the leading widget

TYPE: str

label_text

Text content for the label widget

TYPE: str

Examples:

from morphui.uix.container import MorphIconLabelContainer

class MyButton(MorphIconLabelContainer):
    default_config = MorphIconLabelContainer.default_config.copy()

button = MyButton(
    leading_icon='home',
    label_text='Home')

MorphIconLabelIconContainer(**kwargs)

Bases: MorphLeadingWidgetBehavior, MorphLabelWidgetBehavior, MorphTrailingWidgetBehavior, _MorphBaseContainer

Container with leading icon, text label, and trailing icon.

This container provides a horizontal layout with three child widgets: a leading icon, a text label, and a trailing icon. It is designed to be inherited by components that need this layout pattern (e.g., menu items, list items, chips).

This class only provides the core layout and widget management. Subclasses should add additional behaviors like: - :class:~morphui.uix.behaviors.MorphColorThemeBehavior - :class:~morphui.uix.behaviors.MorphInteractionLayerBehavior - :class:~morphui.uix.behaviors.MorphSurfaceLayerBehavior

ATTRIBUTE DESCRIPTION
leading_icon

Icon name for the leading widget

TYPE: str

label_text

Text content for the label widget

TYPE: str

trailing_icon

Icon name for the trailing widget

TYPE: str

Examples:

from morphui.uix.container import MorphIconLabelIconContainer

class MyMenuItem(MorphIconLabelIconContainer):
    default_config = MorphIconLabelIconContainer.default_config.copy()

item = MyMenuItem(
    leading_icon='home',
    label_text='Home',
    trailing_icon='chevron-right')

MorphLabelIconContainer(**kwargs)

Bases: MorphTrailingWidgetBehavior, MorphLabelWidgetBehavior, _MorphBaseContainer

Container with text label and trailing icon.

This container provides a horizontal layout with two child widgets: a text label and a trailing icon. It is designed to be inherited by components that need this layout pattern (e.g., buttons with trailing icons, list items).

This class only provides the core layout and widget management. Subclasses should add additional behaviors like: - :class:~morphui.uix.behaviors.MorphColorThemeBehavior - :class:~morphui.uix.behaviors.MorphInteractionLayerBehavior - :class:~morphui.uix.behaviors.MorphSurfaceLayerBehavior

ATTRIBUTE DESCRIPTION
label_text

Text content for the label widget

TYPE: str

trailing_icon

Icon name for the trailing widget

TYPE: str

Examples:

from morphui.uix.container import MorphLabelIconContainer

class MyButton(MorphLabelIconContainer):
    default_config = MorphLabelIconContainer.default_config.copy()

button = MyButton(
    label_text='Settings',
    trailing_icon='chevron-right')