Skip to main content

Segment

A segment for a SegmentedButton.

Inherits: Control

Properties

  • icon - The icon to be displayed in the segment.
  • label - The label (usually a Text) to be displayed in the segment.
  • value - Used to identify this segment.

Properties

iconclass-attributeinstance-attribute

icon: Optional[IconDataOrControl] = None

The icon to be displayed in the segment.

Typically an Icon.

Raises:

  • ValueError - If neither it nor label is set and visible.

labelclass-attributeinstance-attribute

label: Optional[StrOrControl] = None

The label (usually a Text) to be displayed in the segment.

Raises:

  • ValueError - If neither it nor icon is set and visible.

valueinstance-attribute

value: str

Used to identify this segment.