Skip to content

Header

morphui.uix.dataview.header

MorphDataViewHeaderLabel(**kwargs)

Bases: BaseDataViewLabel

A label widget designed for use as a header in a data view.

This class extends the base data view label to provide specific styling and behavior for header labels.

default_config = dict(theme_color_bindings=(dict(normal_content_color='content_surface_color', normal_overlay_edge_color='outline_color')), typography_role='Label', typography_size='medium', typography_weight='Regular', halign='left', valign='center', padding=[dp(8), dp(4)], overlay_edge_width=(dp(0.5)), size_hint=(None, 1), auto_size=(False, False), width=(dp(150)), visible_edges=['right', 'bottom']) class-attribute instance-attribute

Default configuration for the MorphDataViewHeaderLabel.

MorphDataViewHeaderLayout(**kwargs)

Bases: MorphRecycleBoxLayout

A layout for arranging header labels in a data view.

This class extends the base data view layout and MorphRecycleBoxLayout to provide a horizontal layout suitable for header labels.

default_config = dict(theme_color_bindings={'normal_surface_color': 'surface_container_high_color'}, orientation='horizontal', auto_size=(True, False), size_hint_y=None, height=(dp(35))) class-attribute instance-attribute

Default configuration for the MorphDataViewHeaderLayout.

MorphDataViewHeader(**kwargs)

Bases: BaseDataView

A scrollable header for data views, synchronized with the main data view.

This class provides a header component for data views that can scroll horizontally in sync with the associated data view. It uses a custom layout manager to arrange header labels and supports dynamic column naming.

Examples:

from morphui.app import MorphApp
from morphui.uix.dataview.header import MorphDataViewHeader

class MyApp(MorphApp):
    def build(self) -> MorphDataViewHeader:
        self.theme_manager.theme_mode = 'Dark'
        self.theme_manager.seed_color = 'morphui_teal'
        header = MorphDataViewHeader()
        header.column_names = [
            'Name', 'Age', 'Occupation', 'Country', 'Email', 'Phone', 'Company',
            'Position', 'Department', 'Start Date', 'End Date', 'Status',
            'Notes', 'Salary', 'Bonus', 'Manager', 'Team', 'Location',
            'Project', 'Task', 'Deadline', 'Priority', 'Comments', 'Feedback',
            'Rating', 'Score', 'Level', 'Experience', 'Skills', 'Certifications',
            'Languages', 'Hobbies', 'Interests', 'Social Media', 'Website',]
        return header
MyApp().run()

column_names = AliasProperty(_get_column_names, _set_column_names, bind=['data']) class-attribute instance-attribute

List of column names displayed in the header.

This property allows getting and setting the column names for the header. When set, it updates the header's data accordingly.

:attr:column_names is an :class:~kivy.properties.AliasProperty and is bound to changes in the data property.

default_config = dict(do_scroll_x=True, do_scroll_y=False, size_hint=(1, None), bar_width=0) class-attribute instance-attribute

Default configuration for the :class:MorphDataViewHeader.

on_columns_updated(*args)

Event handler called when the columns are updated.

This event is dispatched whenever the column names are changed, allowing for custom behavior to be implemented in response to column updates.