TreeViewItem
An item of a TreeView, with optional subitems.
Example:
fluent.TreeViewItem(
"Documents",
leading=fluent.FluentIcons.FOLDER,
items=[fluent.TreeViewItem("Report.docx")],
)
Inherits: Control
Properties
Events
on_click- Called when this item is clicked.on_expand_change- Called when the user expands or collapses this item.
Properties
expandedclass-attributeinstance-attribute
expanded: bool = FalseWhether the subitems are shown.
Updated when the user expands or collapses this item.
itemsclass-attributeinstance-attribute
items: list[TreeViewItem] = field(default_factory=list)The subitems of this item, shown below it when it is expanded.
leadingclass-attributeinstance-attribute
leading: IconDataOrControl | None = NoneAn icon or control shown before content.
Events
on_clickclass-attributeinstance-attribute
on_click: ControlEventHandler[TreeViewItem] | None = NoneCalled when this item is clicked.
on_expand_changeclass-attributeinstance-attribute
on_expand_change: (
ControlEventHandler[TreeViewItem] | None
) = NoneCalled when the user expands or collapses this item.
expanded holds the new state.