InfoBar
A Fluent info bar: an inline message about the state of the app, colored
by its severity.
Example:
fluent.InfoBar(
title="Update available",
content="Restart the app to install it.",
severity=fluent.InfoBarSeverity.WARNING,
)

Inherits: LayoutControl
Properties
action- A control shown aftercontent, usually aButton.content- The text shown aftertitle.icon_visible- Whether the severity icon is shown.long- Whethercontentandactionare shown belowtitleinstead of on the same line, for longer messages.severity- The severity of the message, which sets the color and icon.title- The title of the message.
Events
on_close- Called when the close button is clicked.
Example
Fluent InfoBar
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent InfoBar"
def handle_close(e: ft.Event[fluent.InfoBar]):
e.control.visible = False
page.add(
ft.SafeArea(
content=ft.Column(
width=500,
controls=[
fluent.InfoBar(
title="Update available",
content="Restart the app to install it.",
action=fluent.Button("Restart"),
),
fluent.InfoBar(
title="Saved",
content="Your changes were saved.",
severity=fluent.InfoBarSeverity.SUCCESS,
on_close=handle_close,
),
fluent.InfoBar(
title="Low disk space",
content="Free some space to keep syncing.",
severity=fluent.InfoBarSeverity.WARNING,
),
fluent.InfoBar(
title="Sync failed",
content="Check your connection and try again.",
severity=fluent.InfoBarSeverity.ERROR,
),
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
contentclass-attributeinstance-attribute
content: StrOrControl | None = NoneThe text shown after title.
icon_visibleclass-attributeinstance-attribute
icon_visible: bool = TrueWhether the severity icon is shown.
longclass-attributeinstance-attribute
long: bool = FalseWhether content and action are shown below title
instead of on the same line, for longer messages.
severityclass-attributeinstance-attribute
severity: InfoBarSeverity = InfoBarSeverity.INFOThe severity of the message, which sets the color and icon.
Events
on_closeclass-attributeinstance-attribute
on_close: ControlEventHandler[InfoBar] | None = NoneCalled when the close button is clicked.
The close button is only shown when this handler is set. The info bar is not hidden automatically: hide or remove it in the handler.