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
content- The control shown next to the pane while this item is selected.expanded- Whetheritemsare shown when the view first appears.icon- The icon of this item, the only part shown in a compact pane.info_badge- A badge shown at the end of the item, usually anInfoBadge.items- Items shown below this one when it is expanded:PaneItem,PaneItemHeaderandPaneItemSeparatorcontrols.title- The label of this item.trailing- A control shown at the end of the item.
Events
on_click- Called when this item is clicked.
Properties
contentclass-attributeinstance-attribute
content: Control | None = NoneThe control shown next to the pane while this item is selected.
Usually a ScaffoldPage.
expandedclass-attributeinstance-attribute
expanded: bool = FalseWhether items are shown when the view first appears.
iconclass-attributeinstance-attribute
icon: IconDataOrControl | None = NoneThe icon of this item, the only part shown in a compact pane.
info_badgeclass-attributeinstance-attribute
info_badge: Control | None = NoneA 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.
Events
on_clickclass-attributeinstance-attribute
on_click: ControlEventHandler[PaneItem] | None = NoneCalled when this item is clicked.