DropdownOption
Represents an item in a dropdown.
Inherits: Control
Properties
content- AControlto 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] = NoneA 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] = NoneOption's key.
If not specified text will be used as fallback.
Raises:
- ValueError - If neither
keynor text is provided.
leading_iconclass-attributeinstance-attribute
leading_icon: Optional[IconDataOrControl] = NoneAn optional icon to display before the content or text.
styleclass-attributeinstance-attribute
style: Optional[ButtonStyle] = NoneCustomizes this menu item's appearance.
textclass-attributeinstance-attribute
text: Optional[str] = NoneOption's display text.
If not specified key will be used as fallback.
Raises:
- ValueError - If neither key nor
textis provided.
trailing_iconclass-attributeinstance-attribute
trailing_icon: Optional[IconDataOrControl] = NoneAn optional icon to display after the content or text.