kivymd.navigationdrawer module¶
Navigation Drawer¶
API¶
-
class
kivymd.navigationdrawer.
NavigationDrawerHeaderBase
¶ Tells the
MDNavigationDrawer
that this should be in the header area (above theScrollView
).
-
class
kivymd.navigationdrawer.
NavigationDrawerIconButton
(**kwargs)¶ Bases:
kivymd.list.OneLineIconListItem
An item in the
MDNavigationDrawer
.-
active_color
¶ Custom active color. This option only takes effect when
active_color_type
= ‘custom’.active_color
is aListProperty
and 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_color
attribute.
active_color_type
is aOptionProperty
and defaults to ‘primary’.
-
icon
¶ Icon that appears to the left of the widget.
icon
is aStringProperty
and 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_text
is aStringProperty
and defaults to ”.
-
use_active
¶ If the button should change to the active color when selected.
use_active
is aBooleanProperty
and defaults to True.- See also:
-
-
class
kivymd.navigationdrawer.
NavigationDrawerSubheader
(**kwargs)¶ Bases:
kivymd.list.OneLineListItem
A subheader for separating content in
MDNavigationDrawer
Works well alongside
NavigationDrawerDivider
-
class
kivymd.navigationdrawer.
NavigationDrawerDivider
(**kwargs)¶ Bases:
kivymd.list.OneLineListItem
A 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 mainScrollView
content area.
-
-
class
kivymd.navigationdrawer.
NavigationLayout
(**kwargs)¶ Bases:
kivymd.vendor.navigationdrawer.NavigationDrawer
,kivymd.theming.ThemableBehavior
The 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
-