Skip to main content

DropdownOption

Represents an item in a dropdown.

Inherits: Control

Properties

  • content - A Control to display in this option.
  • key - Option's key.
  • leading_icon - An optional icon to display before the content or text.
  • style - Customizes this menu item's appearance.
  • text - Option's display text.
  • trailing_icon - An optional icon to display after the content or text.

Properties

contentclass-attributeinstance-attribute

content: Optional[Control] = None

A Control to display in this option. If not specified, text will be used as fallback, else text will be ignored.

keyclass-attributeinstance-attribute

key: Optional[str] = None

Option's key.

If not specified text will be used as fallback.

Raises:

  • ValueError - If neither key nor text is provided.

leading_iconclass-attributeinstance-attribute

leading_icon: Optional[IconDataOrControl] = None

An optional icon to display before the content or text.

styleclass-attributeinstance-attribute

style: Optional[ButtonStyle] = None

Customizes this menu item's appearance.

textclass-attributeinstance-attribute

text: Optional[str] = None

Option's display text.

If not specified key will be used as fallback.

Raises:

  • ValueError - If neither key nor text is provided.

trailing_iconclass-attributeinstance-attribute

trailing_icon: Optional[IconDataOrControl] = None

An optional icon to display after the content or text.