CommandBarButton
A command in a CommandBar: an icon with a label
in the bar, or a menu item in its "More" menu.
Example:
fluent.CommandBarButton(
icon=fluent.FluentIcons.ADD, content="New", on_click=new_item
)
Inherits: Control
Properties
contentclass-attributeinstance-attribute
content: StrOrControl | None = NoneThe label of this command.
A compact bar shows it only when there is no icon.
iconclass-attributeinstance-attribute
icon: IconDataOrControl | None = NoneThe icon of this command.
tooltipclass-attributeinstance-attribute
tooltip: str | None = NoneText shown when the mouse pointer rests on this command.
In the "More" menu, it is also shown at the end of the item.
Events
on_clickclass-attributeinstance-attribute
on_click: (
ControlEventHandler[CommandBarButton] | None
) = NoneCalled when this command is clicked.