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: Control | None = 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: str | None = 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: IconDataOrControl | None = None

An optional icon to display before the content or text.

styleclass-attributeinstance-attribute​

style: ButtonStyle | None = None

Customizes this menu item's appearance.

textclass-attributeinstance-attribute​

text: str | None = 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: IconDataOrControl | None = None

An optional icon to display after the content or text.