Skip to main content

Tab

A Material Design TabBar tab.

Inherits: AdaptiveControl

Properties

  • height - The height of the tab.
  • icon - An icon to display on the left of Tab text.
  • icon_margin - The margin added around the tab's icon.
  • label - The tab's name.

Properties

heightclass-attributeinstance-attribute

height: Optional[Number] = None

The height of the tab.

If None, it will be calculated based on the content of the Tab. When icon is not None along with label, the default height is 72.0 pixels. Without an icon, the height is 46.0 pixels.

Currently, the provided tab height cannot be lower than the default height.

iconclass-attributeinstance-attribute

icon: Optional[IconDataOrControl] = None

An icon to display on the left of Tab text.

icon_marginclass-attributeinstance-attribute

icon_margin: Optional[MarginValue] = None

The margin added around the tab's icon.

Only useful when used in combination with icon, and label is not None.

Defaults to 2 pixels of bottom margin. If flet.Theme.use_material3 is False, then defaults to 10 pixels of bottom margin.

labelclass-attributeinstance-attribute

label: Optional[StrOrControl] = None

The tab's name. Can be either a string or a control.

Raises:

  • ValueError - If both label and icon are not set.