SplitButton
A Fluent split button: a button for the main action, and a chevron next to it that opens a menu of related actions.
Example:
fluent.SplitButton(
"Paste",
on_click=paste,
items=[
fluent.MenuFlyoutItem("Paste as text"),
fluent.MenuFlyoutItem("Paste with formatting"),
],
)

Inherits: LayoutControl
Properties
checked- Whether the button is on, for a toggle split button.content- The label of the main part of the button.flyout- A control shown in the popup instead of a menu ofitems, for example a grid of colors to pick from.items- The menu items:MenuFlyoutItem,ToggleMenuFlyoutItem,RadioMenuFlyoutItemandMenuFlyoutSeparatorcontrols.
Events
Example
Fluent SplitButton
import flet_fluent_ui as fluent
import flet as ft
COLORS = {
"Yellow": ft.Colors.YELLOW_200,
"Green": ft.Colors.GREEN_200,
"Blue": ft.Colors.BLUE_200,
}
def main(page: ft.Page):
page.title = "Fluent SplitButton"
color = "Yellow"
def highlight(e: ft.Event[fluent.SplitButton]):
sample.bgcolor = COLORS[color]
def pick_color(e: ft.Event[fluent.MenuFlyoutItem]):
nonlocal color
color = e.control.content
button.content = f"Highlight: {color}"
sample.bgcolor = COLORS[color]
button = fluent.SplitButton(
"Highlight: Yellow",
on_click=highlight,
items=[
fluent.MenuFlyoutItem(
name,
leading=ft.Container(width=12, height=12, bgcolor=value),
on_click=pick_color,
)
for name, value in COLORS.items()
],
)
sample = ft.Container(
padding=4,
content=ft.Text("The meeting moved to Thursday."),
)
page.add(ft.SafeArea(content=ft.Column(controls=[button, sample])))
if __name__ == "__main__":
ft.run(main)

Properties
checkedclass-attributeinstance-attribute
checked: bool | None = NoneWhether the button is on, for a toggle split button.
If None, this is a regular split button. If True or False, clicking
the main part turns the button on or off, and it is filled with the
accent color while it is on.
flyoutclass-attributeinstance-attribute
flyout: Control | None = NoneA control shown in the popup instead of a menu of items, for
example a grid of colors to pick from.
itemsclass-attributeinstance-attribute
items: list[Control] = field(default_factory=list)The menu items: MenuFlyoutItem,
ToggleMenuFlyoutItem,
RadioMenuFlyoutItem and
MenuFlyoutSeparator controls.
Events
on_changeclass-attributeinstance-attribute
on_change: ControlEventHandler[SplitButton] | None = NoneCalled when the user turns a toggle split button on or off.
checked holds the new state.
on_clickclass-attributeinstance-attribute
on_click: ControlEventHandler[SplitButton] | None = NoneCalled when the main part of the button is clicked.