kivymd.navigationdrawer module¶
Navigation Drawer¶
API¶
-
class
kivymd.navigationdrawer.NavigationDrawerHeaderBase¶ Tells the
MDNavigationDrawerthat this should be in the header area (above theScrollView).
-
class
kivymd.navigationdrawer.NavigationDrawerIconButton(**kwargs)¶ Bases:
kivymd.list.OneLineIconListItemAn item in the
MDNavigationDrawer.-
active_color¶ Custom active color. This option only takes effect when
active_color_type= ‘custom’.active_coloris aListPropertyand defaults to None.
-
active_color_type¶ Decides which color should be used for the active color. This option only takes effect when
use_active= True.- Options:
primary: Active color will be the primary theme color.
accent: Active color will be the theme’s accent color.
custom: Active color will be taken from the
active_colorattribute.
active_color_typeis aOptionPropertyand defaults to ‘primary’.
-
icon¶ Icon that appears to the left of the widget.
iconis aStringPropertyand defaults to ‘checkbox-blank-circle’.
-
badge_text¶ Text that appears on the right side of the item, usually for displaying a count of sorts.
badge_textis aStringPropertyand defaults to ”.
-
use_active¶ If the button should change to the active color when selected.
use_activeis aBooleanPropertyand defaults to True.- See also:
-
-
class
kivymd.navigationdrawer.NavigationDrawerSubheader(**kwargs)¶ Bases:
kivymd.list.OneLineListItemA subheader for separating content in
MDNavigationDrawerWorks well alongside
NavigationDrawerDivider
-
class
kivymd.navigationdrawer.NavigationDrawerDivider(**kwargs)¶ Bases:
kivymd.list.OneLineListItemA small full-width divider that can be placed in the
MDNavigationDrawer
-
class
kivymd.navigationdrawer.MDNavigationDrawer(**kwargs)¶ Bases:
kivy.uix.boxlayout.BoxLayout,kivymd.theming.ThemableBehavior,kivymd.elevationbehavior.RectangularElevationBehavior-
add_widget(widget, index=0)¶ If the widget is a subclass of
NavigationDrawerHeaderBase, then it will be placed above theScrollView. Otherwise, it will be placed in the mainScrollViewcontent area.
-
-
class
kivymd.navigationdrawer.NavigationLayout(**kwargs)¶ Bases:
kivymd.vendor.navigationdrawer.NavigationDrawer,kivymd.theming.ThemableBehaviorThe container layout that manages the
MDNavigationDrawer.-
add_widget(widget, **kwargs)¶ First widget added must be the content for the side/sliding panel. The next widget must be the main content.
This layout only accepts two widgets, any more than two widgets will raise a ValueError
-