Skip to main content

PaneItem

An item of the pane of a NavigationView.

An item with content is a page: clicking it selects it and shows its content. An item without content is an action, which only calls on_click. An item with items expands to show them.

Example:

fluent.PaneItem(
"Inbox",
icon=fluent.FluentIcons.MAIL,
content=ft.Text("Your messages"),
)

Inherits: Control

Properties

Events

  • on_click - Called when this item is clicked.

Properties​

contentclass-attributeinstance-attribute​

content: Control | None = None

The control shown next to the pane while this item is selected.

Usually a ScaffoldPage.

expandedclass-attributeinstance-attribute​

expanded: bool = False

Whether items are shown when the view first appears.

iconclass-attributeinstance-attribute​

icon: IconDataOrControl | None = None

The icon of this item, the only part shown in a compact pane.

info_badgeclass-attributeinstance-attribute​

info_badge: Control | None = None

A badge shown at the end of the item, usually an InfoBadge.

itemsclass-attributeinstance-attribute​

items: list[Control] = field(default_factory=list)

Items shown below this one when it is expanded: PaneItem, PaneItemHeader and PaneItemSeparator controls.

titleinstance-attribute​

title: StrOrControl

The label of this item.

trailingclass-attributeinstance-attribute​

trailing: Control | None = None

A control shown at the end of the item.

Events​

on_clickclass-attributeinstance-attribute​

on_click: ControlEventHandler[PaneItem] | None = None

Called when this item is clicked.