Drop-down List (lv_dropdown)
Shows a selected value and opens a list to pick one option.
Overview
The Drop-down List shows a single selected value and, when activated, opens a list of options for the user to pick from. The list closes automatically once a new option is selected.
Learn more in the LVGL Open documentation.
Properties
Parts
Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.
| Part | Description |
|---|---|
main | The closed button: background and text properties. Gets the 'checked' state while the list is open. |
indicator | The symbol shown next to the text (set via symbol): image_recolor and image_recolor_opa. |
Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.
| Property | Type | Description |
|---|---|---|
text | string | Set text displayed instead of the selected option label |
options | string | Set options as a newline (\n) separated string |
selected | int | Select an option by index (0-based) |
symbol | image | Set a symbol shown next to the dropdown |
bind_value | subject | Bind the selected option index to a subject |
dir | enum:lv_dir | Tells in which direction the dropdown should be opened |
<lv_dropdown-list>
The dropdown list object for styling or customization
access get · returns lv_obj
Parts
| Part | Description |
|---|---|
main | The open list background: background, border and padding. max_height caps the open list size. |
scrollbar | The list's scrollbar: width (thickness), background properties and padding on the respective side. |
selected | The highlighted option: background and text properties. The 'checked' state styles the currently selected option and 'pressed' the one being pressed/keyed. |
No attributes — created as an empty child.
Last updated on