Flyout
A Fluent flyout: a light popup attached to content, opened and
closed with open.
Example:
def toggle(e):
flyout.open = not flyout.open
flyout = fluent.Flyout(
content=fluent.Button("Empty cart", on_click=toggle),
flyout=ft.Text("All items will be removed. Do you want to continue?"),
)

Inherits: LayoutControl
Properties
content- The control the flyout is attached to.dismiss_on_pointer_move_away- Whether the flyout closes when the mouse pointer leaves both the flyout andcontent.dismissible- Whether clicking outside the flyout, or pressing Escape, closes it.flyout- The control shown in the popup.open- Whether the flyout is shown.placement- Where the flyout opens relative tocontent.
Events
on_dismiss- Called when the flyout is closed other than by settingopentoFalse: by the user, or by resizing the window.
Example
Fluent Flyout
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent Flyout"
def open_flyout(e: ft.Event[fluent.Button]):
flyout.open = True
def empty_cart(e: ft.Event[fluent.Button]):
flyout.open = False
cart.value = "Your cart is empty"
empty_button.disabled = True
cart = ft.Text("3 items in your cart")
empty_button = fluent.Button("Empty cart", on_click=open_flyout)
flyout = fluent.Flyout(
content=empty_button,
flyout=ft.Column(
tight=True,
width=240,
controls=[
ft.Text("All items will be removed. Do you want to continue?"),
fluent.Button("Yes, empty my cart", on_click=empty_cart),
],
),
)
page.add(ft.SafeArea(content=ft.Column(controls=[cart, flyout])))
if __name__ == "__main__":
ft.run(main)

Properties
dismiss_on_pointer_move_awayclass-attributeinstance-attribute
dismiss_on_pointer_move_away: bool = FalseWhether the flyout closes when the mouse pointer leaves both the flyout
and content.
dismissibleclass-attributeinstance-attribute
dismissible: bool = TrueWhether clicking outside the flyout, or pressing Escape, closes it.
openclass-attributeinstance-attribute
open: bool = FalseWhether the flyout is shown.
Resizing the window closes the flyout, which calls on_dismiss.
placementclass-attributeinstance-attribute
placement: FlyoutPlacementMode = FlyoutPlacementMode.AUTOWhere the flyout opens relative to content.
Events
on_dismissclass-attributeinstance-attribute
on_dismiss: ControlEventHandler[Flyout] | None = NoneCalled when the flyout is closed other than by setting open to
False: by the user, or by resizing the window.
open is set to False before this is called.