Skip to main content

ScaffoldPage

A Fluent page: a header, content and footer, with Fluent page margins.

Use it as the content of the pages of a NavigationView.

Example:

fluent.ScaffoldPage(
header=fluent.PageHeader(title="Inbox"),
content=ft.Text("No new messages"),
)
ScaffoldPage
ScaffoldPage

Inherits: LayoutControl

Properties

Example​

Fluent ScaffoldPage​

Sourceplay_arrowTry Online
import flet_fluent_ui as fluent

import flet as ft


def main(page: ft.Page):
page.title = "Fluent ScaffoldPage"
page.padding = 0

photos = 4

def add_photo(e: ft.Event[fluent.CommandBarButton]):
nonlocal photos
photos += 1
status.value = f"{photos} photos"

status = ft.Text("4 photos")

page.add(
fluent.ScaffoldPage(
expand=True,
header=fluent.PageHeader(
title="Photos",
command_bar=fluent.CommandBar(
alignment=ft.MainAxisAlignment.END,
primary_items=[
fluent.CommandBarButton(
icon=fluent.FluentIcons.ADD,
content="Import",
on_click=add_photo,
),
fluent.CommandBarButton(
icon=fluent.FluentIcons.SHARE, content="Share"
),
],
),
),
content=status,
)
)


if __name__ == "__main__":
ft.run(main)
scaffold_page
Importing a photo from the page header

Properties​

bgcolorclass-attributeinstance-attribute​

bgcolor: ColorValue | None = None

The background color of the page.

If None, the page is transparent inside a NavigationView, and otherwise uses the Fluent page background color.

contentclass-attributeinstance-attribute​

content: Control | None = None

The content of the page, which fills the space below header.

footerclass-attributeinstance-attribute​

footer: Control | None = None

A control shown at the bottom of the page.

headerclass-attributeinstance-attribute​

header: Control | None = None

The header of the page, usually a PageHeader.

paddingclass-attributeinstance-attribute​

padding: PaddingValue | None = None

The space around content.

If None, Fluent's page margins are used, which are smaller on narrow pages.