Dropdown
A dropdown control that allows users to select a single option from a list of options.
Example:
ft.Dropdown(
width=220,
value="alice",
options=[
ft.DropdownOption(key="alice", text="Alice"),
ft.DropdownOption(key="bob", text="Bob"),
],
)

Inherits: LayoutControl
Properties
autofocus- Whether the control will be selected as the initial focus.bgcolor- The background color of the dropdown menu in variousControlStatestates.border- The border drawn around the decorated input area.border_colordeprecated - The border color.border_radiusdeprecated - Rounds the corners of an outlined border.border_widthdeprecated - The width of the border in virtual pixels.capitalization- Configures how the text input should be capitalized.color- Text color.content_padding- The padding for the input decoration's container.dense- Whether the TextField is part of a dense form (i.e., uses less vertical space).editable- Whether the dropdown allows editing of the text input field.elevation- The dropdown's menu elevation in variousControlStatestates.enable_filter- Determine if the menu list can be filtered by the text input.enable_search- Determine if the first item that matches the text input can be highlighted.error_style- TheTextStyleto use forerror_text.error_text- Text that appears below the input border.expanded_insets- The insets for the expanded dropdown menu.fill_color- Background color of the dropdown input text field.filled- Whether the decoration's container is filled with themefill_color.focused_border_colordeprecated - Border color in focused state.focused_border_widthdeprecated - Border width in focused state.helper_style- TheTextStyleto use forhelper_text.helper_text- Text that provides context about the input's value, such as how the value will be used.hint_style- TheTextStyleto use forhint_text.hint_text- Text that suggests what sort of input the field accepts.hover_color- The color of the dropdown input text field when hovered.input_filter- A filter to apply to the text input field.label- Optional text that describes the input field.label_style- Thelabel's text style.leading_icon- An optional Icon at the front of the text input field inside the decoration box.menu_height- The height of the dropdown menu.menu_style- The menu style that defines the visual attributes of the menu.menu_width- The width of the dropdown menu.options- A list of options to display in the dropdown.selected_suffix- A control to display after the selected item in the dropdown.selected_trailing_icon- An optional icon at the end of the text field to indicate that the text field is pressed.text- The text entered in the text field.text_align- The text align for the TextField of the Dropdown.text_size- Text size in virtual pixels.text_style- TheTextStyleto use for text in input text field.trailing_icon- An icon to display at the end of the text field.value- TheDropdownOption.keyof the dropdownoptionscorresponding to the selected option.
Events
on_blur- Called when the control has lost focus.on_focus- Called when the control has received focus.on_select- Called when the selected item of this dropdown has changed.on_text_change- Called when thetextinput of this dropdown has changed.
Methods
focus- Requests focus for this control.