kivymd.bottomsheet module¶
Bottom Sheets¶
Material Design spec Bottom Sheets page
In this module there’s the MDBottomSheet
class which will let you implement your own Material Design Bottom Sheets, and there are two classes called MDListBottomSheet
and MDGridBottomSheet
implementing the ones mentioned in the spec.
Examples¶
Note
These widgets are designed to be called from Python code only.
For MDListBottomSheet
:
bs = MDListBottomSheet()
bs.add_item("Here's an item with text only", lambda x: x)
bs.add_item("Here's an item with an icon", lambda x: x, icon='md-cast')
bs.add_item("Here's another!", lambda x: x, icon='md-nfc')
bs.open()
For MDListBottomSheet
:
bs = MDGridBottomSheet()
bs.add_item("Facebook", lambda x: x, icon_src='./assets/facebook-box.png')
bs.add_item("YouTube", lambda x: x, icon_src='./assets/youtube-play.png')
bs.add_item("Twitter", lambda x: x, icon_src='./assets/twitter.png')
bs.add_item("Da Cloud", lambda x: x, icon_src='./assets/cloud-upload.png')
bs.add_item("Camera", lambda x: x, icon_src='./assets/camera.png')
bs.open()