Divider#

#

New in version 2.0.0.

Dividers are thin lines that group content in lists or other containers.

https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/divider.png
  • Make dividers visible but not bold

  • Only use dividers if items can’t be grouped with open space

  • Use dividers to group things, not separate individual items

KivyMD provides the following bar positions for use:

HorizontalDivider#

Dividers are one way to visually group components and create hierarchy. They can also be used to imply nested parent/child relationships.

https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/divider-horizontal-desc.png
from kivy.lang import Builder

from kivymd.app import MDApp

KV = '''
MDScreen:
    md_bg_color: self.theme_cls.backgroundColor

    MDDivider:
        size_hint_x: .5
        pos_hint: {'center_x': .5, 'center_y': .5}
'''


class Example(MDApp):
    def build(self):
        self.theme_cls.theme_style = "Dark"
        return Builder.load_string(KV)


Example().run()
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/divider-horizontal.png

VerticalDivider#

A vertical divider can be used to arrange content on a larger screen, such as separating paragraph text from video or imagery media.

https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/divider-vertical-desc.png
MDDivider:
    size_hint_y: .5
    orientation: "vertical"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/divider-vertical.png

API break#

1.2.0 version#

MDSeparator:
    [...]

2.0.0 version#

MDDivider:
    [...]

API - kivymd.uix.divider.divider#

class kivymd.uix.divider.divider.MDDivider(**kwargs)#

A divider line.

New in version 2.0.0.

For more information, see in the BoxLayout class documentation.

color#

Divider color in (r, g, b, a) or string format.

color is a ColorProperty and defaults to None.

divider_width#

Divider width.

divider_width is an NumericProperty and defaults to dp(1).

on_orientation(*args) None#

Fired when the values of orientation change.