Skip to content

SideNavHeader

Bases: Frame

A non-selectable section header for grouping navigation items.

SideNavHeader provides a text label to identify groups of related navigation items. Unlike SideNavItem, headers are not selectable and serve only as visual labels. Uses the 'label' font token for styling.

Example
nav.add_item('home', text='Home', icon='house')
nav.add_header('Favorites')  # Creates SideNavHeader
nav.add_item('photos', text='Photos', icon='image')
nav.add_item('music', text='Music', icon='music-note')

text property

text: str

Get the header text.

__init__

__init__(
    master: Master = None,
    text: str = "",
    **kwargs: Unpack[SideNavHeaderKwargs],
)

Initialize a SideNavHeader.

Parameters:

Name Type Description Default
master Master | None

Parent widget.

None
text str

The header text to display.

''
**kwargs Unpack[SideNavHeaderKwargs]

Additional arguments passed to Frame.

{}