⌂
›
Reference
›
DropdownM2
DropdownM2
DropdownM2 control. Build it with the dropdown_m2 helper.
Example
dropdown_m2(
value: "Sample",
label: "Label",
icon: "add",
options: [],
on_click: ->(event) {}
)
Properties
align_label_with_hintalignment— Alignment of the content within the control.autofocus— Requests focus when first shown.bgcolor— Background color.border— Border definition.border_color— Border color.border_radius— Corner radius.border_width— Border thickness.collapsedcolor— Foreground color.content_padding— Content padding.countercounter_style— Counter style.densedisabled_hint_contentelevation— Shadow depth (z-height).enable_feedback— Plays touch feedback (sound/haptic) on interaction.errorerror_max_lineserror_style— Error style.fill_color— Fill color.filledfit_parent_sizefocus_color— Color shown while focused.focused_bgcolor— Focused background color.focused_border_color— Focused border color.focused_border_width— Focused border width.focused_color— Focused color.helperhelper_max_lineshelper_style— Helper style.hint_contenthint_fade_durationhint_max_lineshint_style— Hint style.hint_text— Placeholder shown when the field is empty.hover_color— Color shown while hovered.icon— Icon name shown by the control.item_height— Item height.label— Text label shown for the control.label_style— Label style.max_menu_height— Max menu height.options— The selectable options (built with the control's option helper).options_fill_horizontallypadding— Inner spacing between the border and the content.prefixprefix_icon— Prefix icon.prefix_icon_size_constraintsprefix_style— Prefix style.select_icon— Select icon.select_icon_disabled_color— Select icon disabled color.select_icon_enabled_color— Select icon enabled color.select_icon_sizesize_constraints— Min/max size constraints.suffixsuffix_icon— Suffix icon.suffix_icon_size_constraintssuffix_style— Suffix style.text_sizetext_style— Text style.text_vertical_alignvalue— The control's current value.
Plus the common layout and animation properties shared by most controls (expand, visible, disabled, opacity, width, height, align, tooltip, animate_*, …).
Events
on_animation_end— Fired when an animation completes.on_blur— Fired when the control loses focus.on_change— Fired when the value changes.on_click— Fired when the control is clicked/tapped.on_focus— Fired when the control gains focus.on_size_change— Fired when the control's size changes.
Reference
- Family:
materials - Widget type:
dropdownm2 - Helper:
dropdown_m2