Skip to main content

DropDown

The DropDown widget expands a list of options when pressed so you can pick one. Use it for choices such as language or category.

info

Example file: 07_Work_with_Widgets/dropdown_objet.lfp

Definition and role

The DropDown widget draws a combo area that shows the current value, and pressing it reveals the list of items. Selecting an item runs onChanged. Set how the list expands — a combo list or a bottom sheet — along with its colors and size.

  • Category: Contents
  • Default expand mode: combo (combo)
  • Default width: 200

Features

FeatureDescription
Item selectionSelecting an item from the list changes the current value to that item's value.
Expand modeChoose between a combo list (combo) and a bottom sheet (sheet) with comboType.
Selection change detectionWhen the selection changes, onChanged runs and passes the selected value.
AppearanceAdjust the width, height, corner radius, maximum visible item count, and a range of colors.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the DropDown item onto the canvas.
  3. In the property panel, set the selectable items (items) and the initial value (value).
  4. Attach the action you want to run on a selection change to onChanged.
  5. Adjust the expand mode (comboType), colors, and size if needed.

Properties

PropertyDescriptionDefaultValue / type
comboTypeExpand modecombocombo, sheet
sheetTitleSheet title used in bottom sheet modeEmpty stringString
itemsList of selectable items (each item has a title, a subtitle, and a value)NoneList
valueInitial selected value (one of the item values)NoneString
widthCombo width200Number (0 or greater)
comboHeightCombo height26Number (0 or greater)
itemHeightHeight of each item24Number (0 or greater)
boxRadiusCorner radius4Number (0 or greater)
maxShowItemMaximum number of items shown at once10Integer (0 or greater)
comboboxBgColorCombo background color#000000Color
comboboxBorderColorCombo border color#666666Color
titleColorText color of the selected value#FFFFFFColor
subtitleColorSubtitle color of the selected value#A5A5A5Color
itemTitleColorTitle color of list items#A5A5A5Color
itemSubtitleColorSubtitle color of list items#666666Color
unsetTextColorColor of the unset indicator#F44336Color
arrowColorArrow color#FFFFFFColor
itemBgColorList background color#333333Color
itemBorderColorList border color#666666Color
selectedItemColorBackground color of the selected item#151515Color
itemHoverColorItem hover color#623BEBColor
enableWhether the widget is usableOn (true)True / false

Notes and tips

tip

Omit an item's value in items and its title becomes the value. Set value to one of the item values to line up the initial selection.

tip

To show the list as a sheet that slides up from the bottom of the screen on mobile, set comboType to sheet and give sheetTitle a title.

Learn more

tip

For the full set of Widget Controls (Property, Method, Event) that let you drive this widget from a script, visit DropDown Widget Control.