Chip¶
See also
Chips are compact elements that represent an input, attribute, or action.
Usage¶
MDChip:
label: 'Coffee'
color: .4470588235118, .1960787254902, 0, 1
icon: 'coffee'
callback: app.callback_for_menu_items
The user function takes two arguments - the object and the text of the chip:
def callback_for_menu_items(self, instance, value):
print(instance, value)
Choose chip¶
MDChooseChip:
MDChip:
label: 'Earth'
icon: 'earth'
selected_chip_color: .21176470535294, .098039627451, 1, 1
MDChip:
label: 'Face'
icon: 'face'
selected_chip_color: .21176470535294, .098039627451, 1, 1
MDChip:
label: 'Facebook'
icon: 'facebook'
selected_chip_color: .21176470535294, .098039627451, 1, 1
Note
API - kivymd.uix.chip¶
-
class
kivymd.uix.chip.MDChip(**kwargs)¶ Bases:
kivy.uix.boxlayout.BoxLayout,kivymd.theming.ThemableBehavior-
label¶ Chip text.
labelis anStringPropertyand defaults to ‘’.
-
icon¶ Chip icon.
iconis anStringPropertyand defaults to ‘checkbox-blank-circle’.
-
color¶ Chip color in
rgbaformat.coloris anListPropertyand defaults to [].
-
check¶ If True, a checkmark is added to the left when touch to the chip.
checkis anBooleanPropertyand defaults to False.
-
callback¶ Custom method.
callbackis anObjectPropertyand defaults to None.
-
radius¶ Corner radius values.
radiusis anNumericPropertyand defaults to ‘12dp’.
-
selected_chip_color¶ The color of the chip that is currently selected in
rgbaformat.selected_chip_coloris anListPropertyand defaults to [].
-
on_icon(self, instance, value)¶
-
on_touch_down(self, touch)¶
-
-
class
kivymd.uix.chip.MDChooseChip¶ Bases:
kivy.uix.stacklayout.StackLayout-
add_widget(self, widget, index=0, canvas=None)¶
-